-
Notifications
You must be signed in to change notification settings - Fork 5
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
Type information for RunGroupBy.apply() #258
Comments
Is it not possible to use |
Hm, maybe it is. I think I tried using quotes around types (the equivalent of |
I think the I don't think `RunGroupBy is well-typed currently either.
|
The generic TypeVar could work, but binding it to a |
Added typehints in #262 |
Is your feature request related to a problem? Please describe.
I get the error:
if I use
run.groupby(…).apply(…)
. That's a bit sad.Describe the solution you'd like
It would be great to add type information to
RunGroupBy.apply()
, however that's not really possible because there would be a dependency cycle:run.groupby()
returns aRunGroupBy
object (and therefore has to importscmdata.groupby
), andRunGroupBy.apply()
return anScmRun
object (and therefore has to importscmdata.run
).I'm not sure how to properly solve this.
Describe alternatives you've considered
We could:
Protocol
ize ScmRun. Sounds painful and like a lot of work, but would decouple implementation and types clearly.Protocol
ize RunGroupBy. Probably less work, but I'm not sure ifrun.py
can live without importingscmdata.groupby
, so probably doesn't break the cycle?The text was updated successfully, but these errors were encountered: