Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_related_instances does not work with boolean parameters #21

Open
zyko opened this issue Jul 13, 2023 · 0 comments
Open

get_related_instances does not work with boolean parameters #21

zyko opened this issue Jul 13, 2023 · 0 comments

Comments

@zyko
Copy link
Contributor

zyko commented Jul 13, 2023

A task A, that has bool parameters cannot be found with A.get_related_instances() as shown in the following example:

import os
import luisy
import luigi

class MyAbstractClass(luisy.Task):
    def run(self):
        self.write(str("test"))

class MyBoolTask(MyAbstractClass):
    test_boolean = luisy.BoolParameter(False)

class MyIntTask(MyAbstractClass):
    test_int = luisy.IntParameter(42)

task1 = MyBoolTask()
task2 = MyIntTask()
luigi.build([task1, task2], local_scheduler=True)


# show that files are created on disk:
for task_file in os.listdir(os.getenv("WORKING_DIR")):
    if "Task" in task_file:
        print(task_file)

assert MyIntTask.get_related_instances()[0].read() == "test"
assert MyBoolTask.get_related_instances()[0].read() == "test"
# this assert fails, because get_related instances doesn't find any files at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant