Tadas BarzdĹľius
05/26/2022, 5:41 PMsome_op().map(another_op)
E1101: Generator 'generator' has no 'map' member (no-member)
And using context in ops:
No value for argument 'context' in function call (no-value-for-parameter)
sean
05/26/2022, 9:54 PMTadas BarzdĹľius
05/27/2022, 9:24 AMStanley Yang
06/03/2022, 6:36 PMsignature_mutator
instead of function_mutator
. But also, what I took away from this thread is that if the decorator is properly annotated, this wouldn't be an issue
https://github.com/microsoft/pyright/issues/660Tadas BarzdĹľius
06/14/2022, 12:03 PMsean
06/15/2022, 12:47 PM--signature-mutators
option for the typecheck
checker. In theory this just makes functions decorated by the target opaque to pylint, so pylint won’t typecheck e.g. the return value. So adding dagster.op
to pylint’s signature-mutators
should fix the problem in OP.
• That said, I was unable to get it to work-- I included this in a pyproject.toml
but continued to see the original problem:
[tool.pylint.typecheck]
signature-mutators = ['dagster.op']
• In any case, it doesn’t really matter because unfortunately, there is no way for us as library developers to make sure signature-mutators
is set on the user end for functions in our library-- basically signature-mutators
is part of pylint
configuration, and we can’t control user pylint
configuration. The only way we as developers have to communicate with the user’s pylint
is by appropriately annotating our decorators, but in this case I believe we’ve done that but pylint
does not account for it.
Given this, there are two possible solutions:
• *RECOMMENDED: Disable the pylint typecheck
checker. * This checker is redundant with mypy and/or pyright anyway, both of which understand Dagster’s annotations and do not raise an error for OP.
• *ALTERNATIVE: Configure pylint signature-mutators
on the user end to exclude op
. *
@Stanley Yang the thread you linked is for pyright, and it’s correct that Pyright won’t raise errors for properly annotated functions, but that doesn’t seem to be true of pylint.
Please let me know if I’ve missed something here or you have more information!Stanley Yang
06/15/2022, 5:24 PMTadas BarzdĹľius
06/15/2022, 5:35 PM[tool.pylint.typecheck]
signature-mutators = ['op']
I added this snippet to my pyproject.toml and it worked 🙂
But it only solves part of the problem. I’m still getting:
E1101: Generator 'generator' has no 'map' member (no-member)
for code using DynamicOut:
some_op().map(another_op)
sean
06/15/2022, 5:53 PMpylint
, this might be a bug-- it seems like signature-mutators
should disable no-member
checks; or (b) disable the pylint typecheck
checker and use mypy
or pyright
instead. Sorry I don’t have a better solution.Tadas Barzdžius
06/15/2022, 5:59 PM[tool.pylint.typecheck]
generated-members = ["map"]
signature-mutators = ["op"]
Lets say map is a generated-member 🙂