Custom CA cert support for [Async]HamiltonTracker:...
# contribute
f
Custom CA cert support for [Async]HamiltonTracker: https://github.com/DAGWorks-Inc/hamilton/pull/1105 I wonder if we should share a single session object across all the functions in both these...reusing the session object generally improves performance. Also wonder if we can switch to modern-style Type Hints by using:
from __future__ import annotations
e
At first glance this looks reasonable, thanks! WIll look over more shortly. And re: type hints — what’s missing? I haven’t tried in a bit, but if you do that inside a Hamilton file it should parse correctly, right? E.G.
from __future__
is a per-file toggle.
s
Re: annotations — I think we just need to drop support for 3.8 (EOL this year) and we’ll be good right? i.e. can drop some typing imports…
e
I thought we had a toggle to allow for both cases, but it’s really been a while since I dug in
f
Unfortunately 3.9 still needs old-style Hints or
from __future__
Yes, the latter is a per-file thing...I guess what I'm asking here is if you guys object to
from __future__
in files that people edit?
e
@Fran Boon so we had done some work for this, but I’m not sure if this is enough. MInd opening a ticket with a specific example to highlight? We can dig in/see if it works!
f
Great that you support this pattern in user nodes - that's even more important 🙂 I suspect this won't cause problems for internal code, but I'll happily raise a PR with some code following this pattern to trigger a run of unit tests to see 🙂
e
Oh! Ok, I see what you mean — supporting it in the framework code, right?
f
Yes...I see this as a taste thing in most cases....I prefer to look forward with code rather than back
e
This should work, I think it’s a 3.8 feature and we support 3.8 to 3.12 (soonish to drop 3.8). But the unit tests will catch it.
f
This is the kind of thing I'm thinking of: https://github.com/DAGWorks-Inc/hamilton/pull/1108 It also adds pyupgrade pre-commit hook & fixes some encountered ruff 'errors'. I see some complaints in Circle CI for ruff errors in files I didn't even touch (just in the pre-commit, not unit tests)
Note this timebomb pending for the old-style hints: https://beartype.readthedocs.io/en/latest/api_roar/#pep-585-deprecations Although I suspect they'll delay it as too many people will get bitten still
e
Yeah, 3.8 iks EOL, but this is why they pushed back the mandatory aspect, right?
f
3.9 still needs (at least some of) this