Skip to content

Conversation

@DylanGuedes
Copy link
Contributor

Signed-off-by: DylanGuedes [email protected]

What changes were proposed in this pull request?

Changes variable name conflict: input is a built-in python function.

How was this patch tested?

I runned the example and it works fine.

@HyukjinKwon
Copy link
Member

ok to test

"""
An example of how to use DataFrame for ML. Run with::
bin/spark-submit examples/src/main/python/ml/dataframe_example.py <input>
bin/spark-submit examples/src/main/python/ml/dataframe_example.py <dataset>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we change dataset to like .. input_path or path? I think the name dataset is usually used for Dataset instance.

@HyukjinKwon
Copy link
Member

I think it's fine. It should better avoid shadowing builtin names but can you check out other examples too while we are here?

@DylanGuedes
Copy link
Contributor Author

Sure, and thanks for the review! I used the "dataset" name because I checked a few examples that also use it, but I'll rename to path then. I already checked all other examples using grep and this is the only one using "input" name.

@SparkQA
Copy link

SparkQA commented Mar 9, 2018

Test build #88124 has finished for PR 20775 at commit 4685d68.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Signed-off-by: DylanGuedes <[email protected]>
@DylanGuedes
Copy link
Contributor Author

@HyukjinKwon I checked every other built in function and this was the only one being used. What you think?

@SparkQA
Copy link

SparkQA commented Mar 9, 2018

Test build #88125 has finished for PR 20775 at commit 2cb9b57.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# Load input data
print("Loading LIBSVM file with UDT from " + input + ".")
df = spark.read.format("libsvm").load(input).cache()
# Load file from path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just write it as Load an input file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Signed-off-by: DylanGuedes <[email protected]>
@SparkQA
Copy link

SparkQA commented Mar 9, 2018

Test build #88128 has finished for PR 20775 at commit ae97ceb.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@felixcheung felixcheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update the PR title to say [PYTHON] example?

@DylanGuedes DylanGuedes changed the title Changes input variable to not conflict with built-in function [PYTHON] Changes input variable to not conflict with built-in function Mar 10, 2018
@DylanGuedes
Copy link
Contributor Author

Sure. Done.

@HyukjinKwon
Copy link
Member

Merged to master and branch-2.3.

asfgit pushed a commit that referenced this pull request Mar 10, 2018
Signed-off-by: DylanGuedes <djmgguedesgmail.com>

## What changes were proposed in this pull request?

Changes variable name conflict: [input is a built-in python function](https://stackoverflow.com/questions/20670732/is-input-a-keyword-in-python).

## How was this patch tested?

I runned the example and it works fine.

Author: DylanGuedes <[email protected]>

Closes #20775 from DylanGuedes/input_variable.

(cherry picked from commit b6f837c)
Signed-off-by: hyukjinkwon <[email protected]>
@asfgit asfgit closed this in b6f837c Mar 10, 2018
peter-toth pushed a commit to peter-toth/spark that referenced this pull request Oct 6, 2018
Signed-off-by: DylanGuedes <djmgguedesgmail.com>

## What changes were proposed in this pull request?

Changes variable name conflict: [input is a built-in python function](https://stackoverflow.com/questions/20670732/is-input-a-keyword-in-python).

## How was this patch tested?

I runned the example and it works fine.

Author: DylanGuedes <[email protected]>

Closes apache#20775 from DylanGuedes/input_variable.

(cherry picked from commit b6f837c)
Signed-off-by: hyukjinkwon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants