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

Recommend single filter expressions rather than chaining #10

Open
blakehawkins opened this issue Sep 23, 2021 · 0 comments
Open

Recommend single filter expressions rather than chaining #10

blakehawkins opened this issue Sep 23, 2021 · 0 comments

Comments

@blakehawkins
Copy link

blakehawkins commented Sep 23, 2021

@asmello as discussed, it's better style to write complex filters:

df.where(F.col('pokemon').isNull() & ~F.col('cards').isNull())

Rather than chain filters:

df.where(F.col('pokemon').isNull()).filter(~F.col('cards').isNull())

(Taking into account https://github.com/palantir/pyspark-style-guide#refactor-complex-logical-operations)

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

No branches or pull requests

1 participant