Closed tclose closed 10 months ago
Patch coverage: 100.00%
and project coverage change: +4.28%
:tada:
Comparison is base (
103cefc
) 78.71% compared to head (fa7887b
) 82.99%. Report is 3 commits behind head on master.:exclamation: Current head fa7887b differs from pull request most recent head 4809dfe. Consider uploading reports for the commit 4809dfe to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@djarecka this PR is ready to merge now. I'm not sure where the coverage misses are coming from as it is primarily to do with the Dask worker (18 lines). Note that this PR is rebased off #687, so that should be merged first
@djarecka SLURM passed here. It might be worth digging into the runner setup info to see if some details of the machine this is run on differ between successes and crashes/timeouts.
e.g.,
What happens if someone uses from __future__ import annotations
in their module?
What happens if someone uses
from __future__ import annotations
in their module?
That's a good question. I strongly suspect it would break things. However, we should be able to detect them and evaluate the class strings to proper classes when we create interfaces.
Happy to look into this if we end up refactoring the task/interface syntax
What happens if someone uses
from __future__ import annotations
in their module?That's a good question. I strongly suspect it would break things. However, we should be able to detect them and evaluate the class strings to proper classes when we create interfaces.
Happy to look into this if we end up refactoring the task/interface syntax
Actually, looking at the code I think that attrs
probably handles this for us
What happens if someone uses
from __future__ import annotations
in their module?That's a good question. I strongly suspect it would break things. However, we should be able to detect them and evaluate the class strings to proper classes when we create interfaces. Happy to look into this if we end up refactoring the task/interface syntax
Actually, looking at the code I think that
attrs
probably handles this for us
Just checked with the following, and attrs doesn't help us
from __future__ import annotations
import attrs
@attrs.define
class A:
x: int = 0
y: float = 1.0
print(repr(attrs.fields(A).x.type))
Okay. I think it's fair to call that a limitation but not agonize over it. It might cause some cache misses based on changes in Python version or the package that defines a task, but we should be consistent across runs of the same code on the same Python version.
Under what circumstances are we actually hashing types? We're hashing values, so it seems like this should be moot for most cases.
Okay. I think it's fair to call that a limitation but not agonize over it. It might cause some cache misses based on changes in Python version or the package that defines a task, but we should be consistent across runs of the same code on the same Python version.
Under what circumstances are we actually hashing types? We're hashing values, so it seems like this should be moot for most cases.
As I mentioned, I expect it to be pretty specific to my code, but in Arcana, the file-format class that input data files are stored in and output data files should be stored in is passed as an input to the "source" and "sink" nodes
Okay. I think it's fair to call that a limitation but not agonize over it. It might cause some cache misses based on changes in Python version or the package that defines a task, but we should be consistent across runs of the same code on the same Python version.
Under what circumstances are we actually hashing types? We're hashing values, so it seems like this should be moot for most cases.
String annotations will break the type-checking though...
Maybe we just treat strings as Any
and raise a one-time warning?
Maybe we just treat strings as
Any
and raise a one-time warning?
We could do that, or attempt to evaluate them, and if that fails fallback to Any.
I reckon this is ready to merge now as the string annotations are probably best addressed in a separate PR
Summary
Handles the case of hashing a class with type args, typing special forms (e.g. Union, ty.Type) and classes that inherit from ty.Generic
Checklist