Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Series._with_new_scol to use alias. #1634

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

ueshin
Copy link
Collaborator

@ueshin ueshin commented Jul 6, 2020

We should always use alias when IndexOpsMixin._with_new_scol to make sure the column name is valid.

>>> kser = ks.Series([1, 2, 3, 4, 5, 6, 7], name="x")
>>> (kser.rename("y") + 1).head()
Traceback (most recent call last):
...
pyspark.sql.utils.AnalysisException: syntax error in attribute name: `(x AS `y` + 1)`;

Resolves #1633.

@ueshin ueshin requested a review from HyukjinKwon July 6, 2020 23:35
@HyukjinKwon
Copy link
Member

Thanks @ueshin

@HyukjinKwon HyukjinKwon merged commit 3c18bb4 into databricks:master Jul 7, 2020
@ueshin ueshin deleted the with_new_scol branch July 7, 2020 02:20
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.

Binary operation got "AnalysisException" after doing kdf[key] = kdf[key] + 1
2 participants