When calling solid with passing argument getting t...
# announcements
When calling solid with passing argument getting this error. So initial argument can not be passed directly? it always needs to return from another solid? How to pass dynamic value to solid in that case? Can some one help me? I am newbie so sorry for such silly question
Copy code
Hi Keval, if you want to execute a single solid, you can use
, which accepts a dynamic value. Do you need to execute a full pipeline on dynamic inputs? This is a little bit more involved
Hi @sandy Thanks for your reply. I want to execute pipeline and first solid I want to send data as argument. Do you suggest any example for it? thanks in advance.
@alex - do you happen to know whether the graph refactor makes this easier?
you’ld be able to set the default value for the input definition on the graph could will map in to the solid - but that would be a fixed value for that graph for now you should be able to provide that value via the run config for a run of that pipeline - would look like this:
Copy code
      link: <the link>
Copy code
dagster.core.errors.DagsterUserCodeProcessError: (DagsterInvalidDefinitionError) - dagster.core.errors.DagsterInvalidDefinitionError: @solid 'get_url' decorated function does not have required positional parameter 'context'. Solid functions should only have keyword arguments that match input names and a first positional parameter named 'context'.

Stack Trace: 
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\grpc\server.py", line 336, in ListRepositories
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\grpc\server.py", line 106, in loadable_repository_symbols
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\grpc\server.py", line 96, in load
    self._loadable_repository_symbols = load_loadable_repository_symbols(
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\grpc\server.py", line 120, in load_loadable_repository_symbols
    loadable_targets = get_loadable_targets(
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\grpc\utils.py", line 25, in get_loadable_targets
    else loadable_targets_from_python_file(python_file, working_directory)
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\cli\workspace\autodiscovery.py", line 11, in loadable_targets_from_python_file
    loaded_module = load_python_file(python_file, working_directory)
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\core\code_pointer.py", line 95, in load_python_file
    return import_module_from_path(module_name, python_file)
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\seven\__init__.py", line 118, in import_module_from_path
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "hello_dagster.py", line 4, in <module>
    import Utils
  File "C:\Users\kotha\Dropbox\Sample Data Sets\datavalidation\Dagster\Utils.py", line 12, in <module>
    def get_url(url):
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\core\definitions\decorators\solid.py", line 196, in solid
    return _Solid()(name)
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\core\definitions\decorators\solid.py", line 67, in __call__
    positional_inputs = validate_solid_fn("@solid", self.name, fn, input_defs, ["context"])
  File "c:\users\kotha\appdata\local\programs\python\python38-32\lib\site-packages\dagster\core\definitions\decorators\solid.py", line 311, in validate_solid_fn
    raise DagsterInvalidDefinitionError(
And My Code is simple as below : Utils.py
Copy code
def get_url(url):
    #return '<https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv>'
    return url

def download_file(link): 
    print('Downloading File...')
    #<http://context.log.info|context.log.info>("Downloading File From URL:"+link)
    req = requests.get(link,stream=True)
    url_content = req.content
    file = link.split('/')[-1]
    data_file = open(file, 'wb')
    return file
Copy code
def hello_pipeline():
Can some one help what exactly wrong here ?
from the error message
@solid ‘get_url’ decorated function does not have required positional parameter ‘context’. Solid functions should only have keyword arguments that match input names and a first positional parameter named ‘context’.
the first parameter to your
functions need to be
followed by ones you want for parameters. You can use
instead if you don’t need to use anything on the