Try to make dataset objects totally unhashable, redux#42066
Try to make dataset objects totally unhashable, redux#42066potiuk merged 5 commits intoapache:mainfrom
Conversation
|
@potiuk here's something? |
|
This wasn't covered by a test? We should add one. |
|
This should also include the previous changes since they were reverted. |
Well it's revealed by some provider tests that look like they weren't run in #42054's checks. I think the challenge is that this is arg defaults all the way down, there's a long chain of |
I opened this PR before @potiuk reverted 😓 |
|
@uranusjr idk where the dataset e.g. here is the common/io/file one: When #42054 is re-implemented it should be swapped to
and so forth for others. |
Can’t do this because Python… https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments Keeping the default as None and changing it to |
|
I’ve re-applied the previous changes here, and also added a fix so callers (including HookLineageCollector) can continue to pass in a None. It will be converted automatically to a dict. Can you work on a test to cover the |
6223c30 to
9d49ef4
Compare
f59bb72 to
21774a0
Compare
I removed my original change, I think it's best if we keep the call stack as it is and use your fix that coerces the None to {} only in the Dataset constructor, less confusing and easier to test that way imo. I added more tests to create_dataset that cover the dataset_factory API (uri, kwargs, missing factory, and factory exception are covered). |
Dataset extra arg default in HookLineageCollector7a7d4cc to
ea4b231
Compare
|
I added "full-tests-needed" label and closed/reopened to re-run all tests |
Re-post of @uranusjr 's change in #42054, with a bug fixed and tests added.
Original PR description:
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.