I am trying to return path of input zip archive. I am stuck on implementing luigi output method:
def get_zip_path() -> str:
input_zip = ''
with open("/input/index.json", "r") as input_index:
json_str = json.load(input_zip)
input_zip = json_str["source"]
return input_zip
class Input(luigi.Task):
"""
Unpack dicom zip archive to workdir
"""
@property
def zip_path():
return get_zip_path()
def output(self):
return luigi.LocalTarget(self.zip_path())
I want class Input() return method output the string of zip path "/input/zipfile.zip" but get the error
TypeError: zip_path() takes 0 positional arguments but 1 was given
It's a python error rather than an issue with
luigi
Try this: