Skip to content

Error when adding dependency #106

@antoniaen

Description

@antoniaen

When I add a dependency, I get the error message: "TypeError: run_stata_script() got an unexpected keyword argument 'my_keyword_for_dependency'".

I tried to follow your description, which says, "pytask assumes that all function arguments that are not passed to the argument produces are dependencies of the task". My code looks as follows:

from pathlib import Path
from pytask import mark

from mymodule.config import BLD, SRC

@mark.stata(script = SRC / "analysis" / "test.do")
def task_test_stata(my_keyword_for_dependency: Path = BLD / "data" / "data_file.dta"):
       pass

What works is:

  • Using the standard pytask for Python code and adding a dependency in the same way.
  • Adding produces as a keyword and a product of the Stata file.

I installed the current version of pytask and pytask-stata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions