-
Notifications
You must be signed in to change notification settings - Fork 1
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
[ETL-329] delete check #12
Conversation
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.
Just needs some minor changes in the tests. Also, what are the empty __init__.py
files for? Can we get rid of them to reduce clutter?
] | ||
and basename_components[-2] == "Deleted" | ||
): | ||
metadata["type"] = "{}_Deleted".format(metadata["type"]) |
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.
Have you seen f-strings? They're super slick: https://realpython.com/python-f-strings/#f-strings-a-new-and-improved-way-to-format-strings-in-python
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.
Nit: I definitely prefer to use f-string when possible, but personally, the double/single quote is annoying
f"{metadata['type']}_Deleted"
we can...
meta_type = metadata['type']
f"{meta_type}_Deleted"
I am also ok with .format
in this specific scenario.
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.
Yup, I have seen it, but thought that in this scenario, it would look a bit cleaner to have .format.
tests/glue/jobs/test_s3_to_json.py
Outdated
|
||
assert ( | ||
s3_to_json.get_metadata( | ||
"HealthKitV2Heartbeat_Deleted_20201022-20211022.json" |
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.
HealthKitV2Heartbeat_Samples_Deleted_20201022-20211022.json
tests/glue/jobs/test_s3_to_json.py
Outdated
class TestS3ToJsonS3: | ||
def test_get_metadata_type(self): | ||
assert ( | ||
s3_to_json.get_metadata("HealthKitV2Samples_20201022-20211022.json")["type"] |
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.
Use the actual format like HealthKitV2Samples_AppleExerciseTime_20230112-20230114.json
tests/glue/jobs/test_s3_to_json.py
Outdated
|
||
assert ( | ||
s3_to_json.get_metadata( | ||
"HealthKitV2Electrocardiogram_Deleted_20201022-20211022.json" |
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.
HealthKitV2Electrocardiogram_Samples_Deleted_20201022-20211022.json
I had to add them because the test script is nested inside the subdirectories under tests/glue/jobs and adding init.py allows me to import them like |
I want to try the tests for myself -- in the meanwhile, can you update line 50 of the tests README so that all tests are run and not just the lambda tests? |
Hmm I think currently the lambda tests are the only ones that can be run locally via a pipenv which is why I left that to be lambda specific otherwise you'll run into an error with pytest since |
Makes sense. Can you include a sentence that says as much in the README? |
Do you also get this error when running tests?
|
Nope, you're getting this error inside the Docker image? |
Yeah. I figured it out. In the tests it should read:
The file name is different than it is in BD. |
Yup it is different. Are you saying the tests don't have |
I confused myself. I had an untracked file in tests that was using the incorrect import. |
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.
🚀 Nice work! Thanks for all the reviews
Purpose: Expands check for deleted records in all other Healthkit data types in
get_metadata
:Also adds tests, and Dockerfile for testing the changes