[INTEGRATION][AIRFLOW] Clean up unnecessary code in tests for extractors #705
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 mocksget_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
CHANGELOG.md
with details about your change under the "Unreleased" section (if relevant, depending on the change, this may not be necessary)