Pylint complains about missing arguments when using the solid DSL to define pipelines
See original GitHub issuee.g.:
from dagster import pipeline, solid
@solid
def hello_world(_):
return 'hello'
@pipeline
def hello_world_pipeline():
hello_world()
gives the pylint error: No value for argument '_' in function callpylint(no-value-for-parameter)
This is probably something we can fix with an astroid “brain hint”. See: https://stackoverflow.com/questions/38087760/pylint-coroutines-decorators-and-type-inferencing. Docs are lacking, we would have to work from examples in https://github.com/PyCQA/astroid/tree/master/astroid/brain. Something like (this code doesn’t work):
import astroid
def _is_decorated_solid(node):
if not node.decorators:
return False
return 'dagster.core.definitions.decorators.solid' in node.decoratornames()
@astroid.inference_tip
def _infer_decorated_solid(node, context=None):
_args = node.args
_args.defaults = [astroid.nodes.Const(None) for arg in _args]
node.args = _args
return node
astroid.MANAGER.register_transform(
astroid.FunctionDef,
_infer_decorated_solid,
_is_decorated_solid
)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Pylint complains "no value for argument 'cls'" - python
Typically this error is related to non-complaint function signatures. Given your code: class Container(object): def __init__(self, iterable, ...
Read more >Data Pipelines with Apache Airflow - BI Consult
Running pipeline using workflow managers 9. 1.2 Introducing Airflow 10. Defining pipelines flexibly in (Python) code 10 □. Scheduling and.
Read more >arguments-differ / W0221 - Pylint 2.16.0-dev documentation
Used when a method has a different number of arguments than in the implemented interface or in an overridden method. Extra arguments with...
Read more >1.1.7 (core) / 0.17.7 (libraries) - Dagster Docs
New documentation for Code locations and how to define one using Definitions ... to reflect stable dagster-1.0 APIs. pipeline / solid referencing arguments...
Read more >ChangeLog - ftp
After a failed CTRL-W ] next command splits window. * Using freed memory on exit when EXITFREE is defined. * Default constructor arguments...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Lol, or, just wait for https://github.com/PyCQA/pylint/pull/2926 to merge
@mgasner this is resolved now right?