question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pylint complains about missing arguments when using the solid DSL to define pipelines

See original GitHub issue

e.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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mgasnercommented, Sep 4, 2019

Lol, or, just wait for https://github.com/PyCQA/pylint/pull/2926 to merge

0reactions
natekuppcommented, Mar 16, 2020

@mgasner this is resolved now right?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found