Thread
#prefect-community
    l

    Lukas N.

    10 months ago
    Hello, we're observing an issue with Prefect Artifacts and mapped tasks after update to 0.15.6, any ideas how to resolve 🙏 ?
    Kevin Kho

    Kevin Kho

    10 months ago
    Hi @Lukas N., what is the issue?
    l

    Lukas N.

    10 months ago
    this issue is related to https://prefect-community.slack.com/archives/CL09KU1K7/p1634635485031900. We're using the Artifacts beta feature and it broke when we updated to Prefect 0.15.6, also tested on latest 0.15.7, it was working before.
    from prefect.artifacts import create_markdown
    
    import prefect
    from prefect import task, Flow
    
    @task
    def foo(param):
        create_markdown(f'Task {prefect.context["task_full_name"]}: {param}')
    
    with Flow(
        'test_artifacts',    
    ) as flow:
        foo('unmapped') # <-- this works
        foo.map([1, 2, 3]) # <-- this doesn't
    
    if __name__ == "__main__":
        flow.register(project_name='test')
    I'm running the flow locally from UI (
    prefect server start
    +
    prefect agent local start --show-flow-logs
    ). Artifacts for the unmapped task are created fine, for the mapped task it gives
    prefect.exceptions.ClientError: [{'message': '[{\'extensions\': {\'path\': \'$.selectionSet.insert_task_run_artifact.args.objects\', \'code\': \'constraint-violation\'}, \'message\': \'Not-NULL violation. null value in column "tenant_id" violates not-null constraint\'}]', 'locations': [{'line': 2, 'column': 5}], 'path': ['create_task_run_artifact'], 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': '[{\'extensions\': {\'path\': \'$.selectionSet.insert_task_run_artifact.args.objects\', \'code\': \'constraint-violation\'}, \'message\': \'Not-NULL violation. null value in column "tenant_id" violates not-null constraint\'}]'}}}]
    Kevin Kho

    Kevin Kho

    10 months ago
    Is this specifically artifacts or does it affect flows without artifacts too?
    Ok i think there is a bug. I’ll open an issue.
    l

    Lukas N.

    10 months ago
    It's specific to artifacts in mapped tasks only, at least what we're observing
    Kevin Kho

    Kevin Kho

    10 months ago
    Will ask the team to confirm there is an issue.
    l

    Lukas N.

    10 months ago
    just tested few versions of prefect on the ☝️ example,
    0.15.4
    works
    0.15.5
    doesn't
    Kevin Kho

    Kevin Kho

    10 months ago
    I opened it here
    thanks for the details!
    l

    Lukas N.

    10 months ago
    thanks