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

[INTEGRATION][AIRFLOW] Clean up unnecessary code in tests for extractors #705

Merged
merged 2 commits into from Apr 28, 2022

Conversation

sekikn
Copy link
Contributor

@sekikn sekikn commented Apr 27, 2022

Signed-off-by: Kengo Seki sekikn@apache.org

Problem

There are some weird things in the unit test for PostgreExtractor.

https://github.com/OpenLineage/OpenLineage/blob/0.7.1/integration/airflow/tests/extractors/test_postgres_extractor.py#L130-L131
The test_extract method doesn't need this environment variable, since it mocks get_connection instead.
This variable is actually required by test_get_table_schemas, so it should be moved inside there.

https://github.com/OpenLineage/OpenLineage/blob/0.7.1/integration/airflow/tests/extractors/test_postgres_extractor.py#L192-L194
This hook isn't used anywhere, so it can be removed.

We can also find similar problems in the tests for SnowflakeExtractor and MySqlExtractor (because I wrote the latter by copy-and-pasting from PostgreExtractor...).

Solution

This PR moves and deletes the code explained above.

Checklist

  • You've signed-off your work
  • Your pull request title follows our guidelines
  • Your changes are accompanied by tests (if relevant)
  • Your change contains a small diff and is self-contained
  • You've updated any relevant documentation (if relevant)
  • You've updated the CHANGELOG.md with details about your change under the "Unreleased" section (if relevant, depending on the change, this may not be necessary)
  • You've versioned the core OpenLineage model or facets according to SchemaVer (if relevant)

@mobuchowski mobuchowski self-requested a review April 28, 2022 13:39
@mobuchowski mobuchowski merged commit 0c57b5a into OpenLineage:main Apr 28, 2022
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.

None yet

2 participants