https://flyte.org logo
#ask-the-community
Title
# ask-the-community
f

Frank Shen

05/16/2023, 9:23 PM
Hello, My workflow reads from a file parameters.json and pass the dict content of it to the tasks.
Copy code
def get_config():
    current_directory = os.getcwd()
    print("Current directory:", current_directory) # .../dai-mle-paid-renewal
    # Open the JSON file
    with open('parameters.json') as f:
        # Load the contents of the file into a dictionary
        # params = f.read()
        params = json.load(f)
        print(type(params))
        print(params)
        return params
@task
def test(config: Dict[str, Any]) -> None:
    print(config)

@workflow
def wf(config: Dict[str, Any] = get_config()) -> None:
   test(config=config)
76 Views