Pedro Henrique
10/14/2022, 4:41 PMAndrew Brookins
10/14/2022, 4:50 PMPedro Henrique
10/14/2022, 4:58 PMtask.fn()
.\n')
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/cpfl0dev/.vscode-server/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
cli.main()
File "/home/cpfl0dev/.vscode-server/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/home/cpfl0dev/.vscode-server/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
runpy.run_path(target, run_name="__main__")
File "/home/cpfl0dev/.vscode-server/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/cpfl0dev/.vscode-server/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/cpfl0dev/.vscode-server/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "/home/cpfl0dev/de3075/flows_prod/pipeline_fire.py", line 221, in <module>
flow_function()
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/prefect/flows.py", line 429, in call
return enter_flow_run_engine_from_flow_call(
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/prefect/engine.py", line 150, in enter_flow_run_engine_from_flow_call
return anyio.run(begin_run)
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/anyio/_core/_eventloop.py", line 56, in run
return asynclib.run(func, *args, **backend_options) # type: ignore
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 230, in run
return native_run(wrapper(), debug=debug)
File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 225, in wrapper
return await func(*args)
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/prefect/client/utilities.py", line 47, in with_injected_client
return await fn(*args, **kwargs)
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/prefect/engine.py", line 229, in create_then_begin_flow_run
return await state.result(fetch=True)
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/prefect/states.py", line 74, in _get_state_result
raise await get_state_exception(state)
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/prefect/engine.py", line 578, in orchestrate_flow_run
result = await run_sync(flow_call)
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/prefect/utilities/asyncutils.py", line 68, in run_sync_in_worker_thread
return await anyio.to_thread.run_sync(call, cancellable=True)
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/anyio/to_thread.py", line 28, in run_sync
return await get_asynclib().run_sync_in_worker_thread(func, *args, cancellable=cancellable,
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 802, in run_sync_in_worker_thread
return await future
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 740, in run
result = func(*args)
File "/home/cpfl0dev/de3075/flows_prod/pipeline_fire.py", line 178, in flow_function
datetime_now = get_datetimenow()
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/prefect/tasks.py", line 330, in call
return enter_task_run_engine(
File "/home/cpfl0dev/.local/lib/python3.8/site-packages/prefect/engine.py", line 672, in enter_task_run_engine
raise RuntimeError(
RuntimeError: Tasks cannot be run outside of a flow. To call the underlying task function outside of a flow use task.fn()
.Serina
10/20/2022, 8:58 PMimport logging
def get_run_logger():
return logging.getLogger("my_logger")