• varsha Parthasarathy

    varsha Parthasarathy

    1 month ago
    Is there a verbose mode of sorts that we can enable when running flyte workflows? Maybe not always, but when the workflow fails?
    varsha Parthasarathy
    Ketan (kumare3)
    9 replies
    Copy to Clipboard
  • GitHub

    GitHub

    1 month ago
    message has been deleted
  • Abdullah Mobeen

    Abdullah Mobeen

    1 month ago
    Hi, I'm reading the Flyte documentation on extending a task. There are two ways listed.
    @task(task_config=MyContainerExecutionTask(
        plugin_specific_config_a=...,
        plugin_specific_config_b=...,
        ...
    ))
    def foo(...) -> ...:
        ...
    And
    query_task = SnowflakeTask(
        query="Select * from x where x.time < {{.inputs.time}}",
        inputs=kwtypes(time=datetime),
        output_schema_type=pandas.DataFrame,
    )
    
    @workflow
    def my_wf(t: datetime) -> ...:
        df = query_task(time=t)
        return process(df=df)
    I'm trying to find examples/tutorials/how-tos on the first approach, but I can't find any. Can someone point me to an example?
    Abdullah Mobeen
    Ketan (kumare3)
    8 replies
    Copy to Clipboard
  • GitHub

    GitHub

    1 month ago
    message has been deleted
  • Brandon Segal

    Brandon Segal

    1 month ago
    Hey is there anyway to mock the NamedTuple output of a task and have that output then used in a seperate task? I have a situation where I have a task with some output
    class GenerateOutputs(NamedTuple):
            uri: str
        
        @reference_task(
            ...
        )
        def generate(
            input:str 
        ) -> GenerateOutputs:
        ... 
        
        @workflow
        def my_wf(
            input="default_input"
        ) -> str:
        output = generate(
            input:str=input
        )
        return output.uri
    However anytime I try to mock this out with something like
    class TestNamedTuple(TestCase):
        def test_run_workflow(self):
            with task_mock(generate) as fake_generate:
                fake_generate.return_value = GenerateOutputs(uri="test_uri")
                uri = my_wf()
                self.assertIsNotNone(uri)
    I get an error like :
    AttributeError: 'Promise' object has no attribute 'uri'
    How do I properly mock a task that has a namedTuple output with only one attribute?
    Brandon Segal
    Ketan (kumare3)
    3 replies
    Copy to Clipboard
  • GitHub

    GitHub

    1 month ago
    message has been deleted
  • GitHub

    GitHub

    1 month ago
    message has been deleted
  • GitHub

    GitHub

    1 month ago
    message has been deleted
  • GitHub

    GitHub

    1 month ago
    message has been deleted