Xun Wang
07/16/2024, 5:16 PMNate
07/16/2024, 5:19 PMXun Wang
07/16/2024, 5:22 PM@flow(name="ftp_mapping_source_into_db",
description="Flow FTP to DB default remote file: /ftp/HotelContentExporter_FTPUpload/output/09",
task_runner=SequentialTaskRunner())
def ftp_mapping_source_into_db(remote_file: str = '/ftp/HotelContentExporter_FTPUpload/output/09',
knownhosts: str = None):
local_file = ftp_to_csv_flow(remote_file, knownhosts)
source_to_db_task = source_to_db.submit(local_file)
source_to_db_task.wait()
summary_of_mapping_sync_src('workflow')
Xun Wang
07/16/2024, 5:25 PMNate
07/16/2024, 5:26 PMprefect deployment inspect your-flow/your-deployment
Xun Wang
07/16/2024, 5:28 PM{
'id': '439d81f7-5068-40e6-8227-69e211d9d9cf',
'created': '2022-09-07T23:56:06.348366+00:00',
'updated': '2023-10-24T22:05:33.055011+00:00',
'infra_overrides': {},
'name': 'vervotech-deployment',
'version': 'e72dccecba11900b2fd166e5774a0468',
'description': 'Flow (Vervotech): FTP to DB default remote file: /ftp/HotelContentExporter_FTPUpload/output/09',
'flow_id': '02fd7e3f-c7e3-4323-b6d0-0da71dff7cb2',
'schedule': None,
'is_schedule_active': True,
'paused': False,
'schedules': [],
'parameters': {},
'pull_steps': None,
'tags': [],
'work_queue_name': 'cloud-beta',
'last_polled': '2024-07-16T17:28:10.139769+00:00',
'parameter_openapi_schema': {
'type': 'object',
'title': 'Parameters',
'properties': {'knownhosts': {'title': 'knownhosts'}, 'remote_file': {'title': 'remote_file', 'default': '/ftp/HotelContentExporter_FTPUpload/output/09'}}
},
'path': '/home/pentaho/prefect2',
'entrypoint': 'vervotech/vervotech_flow.py:ftp_mapping_source_into_db',
'manifest_path': None,
'storage_document_id': None,
'infrastructure_document_id': '6760e295-85db-42da-9782-18ea923f7355',
'created_by': None,
'updated_by': None,
'work_queue_id': None,
'enforce_parameter_schema': False,
'work_pool_name': 'default-agent-pool',
'status': 'READY',
'infrastructure': {
'type': 'process',
'env': {},
'labels': {},
'name': None,
'command': ['python', '-m', 'prefect.engine'],
'stream_output': True,
'working_dir': None,
'block_type_slug': 'process'
},
'automations': []
}
Nate
07/16/2024, 5:31 PM'parameter_openapi_schema': {
'type': 'object',
'title': 'Parameters',
'properties': {'knownhosts': {'title': 'knownhosts'}, 'remote_file': {'title': 'remote_file', 'default': '/ftp/HotelContentExporter_FTPUpload/output/09'}}
},
this looks right, which makes this error confusing
Function expects parameters ['args', 'kwargs']
I will try to reproduce thisXun Wang
07/16/2024, 9:44 PMQ
07/19/2024, 5:08 PMQ
07/19/2024, 5:57 PMQ
07/19/2024, 5:57 PMengine.py
is ran, which is:
1. using client to load flow run
2. pulling code via run_steps(deployment.pull_steps)
3. importing flow via load_flow_from_entrypoint
4. calling flow_engine._flow_parameters
the way it's called in run_flow
(passing flow
and flow_run
)
The last step returns the parameters that were specified in UI when the run was created.
inspect.signature(fn).parameters
(called in parameters_to_args_kwargs
, fn=flow.fn
) returns the actual parameters of the function, not args/kwargs.Q
07/19/2024, 6:54 PMpython -m prefect.engine FLOW_RUN_ID
on my machine and it succeeded..Q
07/19/2024, 7:13 PMload_flow_from_entrypoint
cannot load a flow (due to a missing dependency for me) it returns a placeholder flow, which, according to a comment is supposed to reraise an exception when ran, but it never gets to since the confusing SignatureMismatchError
is raised before that moment ๐Xun Wang
07/19/2024, 7:17 PMNate
07/19/2024, 8:40 PMTom Matthews
07/25/2024, 9:36 PM2.17.1
, is that expected? Is there any recommendation for resolving this?Nate
07/25/2024, 9:37 PMNate
07/25/2024, 9:38 PMNate
07/25/2024, 9:38 PMNate
07/25/2024, 9:39 PMTom Matthews
07/25/2024, 9:49 PMNate
07/25/2024, 9:50 PM