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

[Bug] flake8 code smells #990

Closed
2 tasks done
danphenderson opened this issue Feb 21, 2024 · 1 comment
Closed
2 tasks done

[Bug] flake8 code smells #990

danphenderson opened this issue Feb 21, 2024 · 1 comment

Comments

@danphenderson
Copy link

danphenderson commented Feb 21, 2024

Is this a new bug in dbt-spark?

  • I believe this is a new bug in dbt-spark
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

When running pre-commit, flake8 identifies some issues. Namely:

(dbt-spark) dbt-spark > pre-commit run --all-files                        
check yaml...............................................................Passed
check json...........................................(no files to check)Skipped
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
check for case conflicts.................................................Passed
black....................................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

dbt/adapters/spark/column.py:59:42: E231 missing whitespace after ':'
dbt/adapters/spark/column.py:60:42: E231 missing whitespace after ':'
dbt/adapters/spark/column.py:61:42: E231 missing whitespace after ':'
dbt/adapters/spark/column.py:62:42: E231 missing whitespace after ':'
dbt/adapters/spark/impl.py:239:47: E713 test for membership should be 'not in'
dbt/adapters/spark/python_submissions.py:50:20: E231 missing whitespace after ':'
dbt/adapters/spark/python_submissions.py:64:20: E231 missing whitespace after ':'
dbt/adapters/spark/python_submissions.py:96:20: E231 missing whitespace after ':'
dbt/adapters/spark/python_submissions.py:118:31: E231 missing whitespace after ':'
dbt/adapters/spark/python_submissions.py:129:20: E231 missing whitespace after ':'
dbt/adapters/spark/python_submissions.py:197:20: E231 missing whitespace after ':'
dbt/adapters/spark/python_submissions.py:211:20: E231 missing whitespace after ':'
dbt/adapters/spark/python_submissions.py:232:20: E231 missing whitespace after ':'
dbt/adapters/spark/python_submissions.py:248:20: E231 missing whitespace after ':'
dbt/adapters/spark/python_submissions.py:291:64: E231 missing whitespace after ':'
tests/unit/utils.py:242:72: E201 whitespace after '{'
tests/unit/utils.py:242:78: E202 whitespace before '}'
tests/unit/utils.py:242:101: E201 whitespace after '{'
tests/unit/utils.py:242:110: E202 whitespace before '}'

mypy.....................................................................Passed

Also, the flake8 config says this:

exclude = test

I believe it was intended to ignore tests. But since the tests namespace has few errors, it would be better practice to fix the errors and remove the exclude statement from the .flake8 config.

Expected Behavior

pre-commit

Steps To Reproduce

Run pre-commit run --all-files

Additional Context

(dbt-spark) dbt-spark > pip freeze | grep flake8 
flake8==6.1.0
@danphenderson danphenderson added bug Something isn't working triage labels Feb 21, 2024
@mikealfare mikealfare added tech_debt support and removed bug Something isn't working triage labels Feb 22, 2024
@colin-rogers-dbt
Copy link
Contributor

This has been fixed with our recent updates to linting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants