-
Notifications
You must be signed in to change notification settings - Fork 81
Eliminate Path(__file__) to locate resource files
#2210
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
base: main
Are you sure you want to change the base?
Conversation
…ed for tests. This removes the need for `Path(__file__)`-based manipulation.
|
✅ 51/51 passed, 5 flaky, 4m34s total Flaky tests:
Running from acceptance #3293 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2210 +/- ##
=======================================
Coverage 64.11% 64.11%
=======================================
Files 101 101
Lines 8675 8676 +1
Branches 902 898 -4
=======================================
+ Hits 5562 5563 +1
Misses 2941 2941
Partials 172 172 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
In addition, update tests: - No more Path(__file__) manipulation. - Test pipeline configurations now use paths relative to the test resources.
Note: the path being loaded doesn't seem to exist, so it's possible that this was broken before (and still is).
| # TODO: Verify this, I don't think it works? (These files are part of the test resources.) | ||
| schema_def = resources.files(assessment_resources).joinpath(f"{source_tech}_schema_def.yml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this worked prior to this PR (or after): this is a pure refactoring.
But it does raise an interesting point: how is this tested?
@sundarshankar89: How can I check this?
Changes
What does this PR do?
This PR eliminates the use of
Path(__file__)to locate file-based resources. In general:importlib.resourcesinstead.importlib.resources, and probably should, but that's a bigger refactoring: this is a first step.)Some incidental changes that are introduced:
test_snowflake.py:test_databricks.pywas misleading.)PipelineConfig(andStep) classes have been made immutable. (An unnecessary__post__init()method has also been eliminated.)Tests