Joseph Loss
05/03/2021, 7:17 PMD:\venv\poetry\.venv\lib\site-packages\prefect\utilities\logging.py:123:
UserWarning: Failed to write logs with error:
ClientError('400 Client Error: Bad Request for url: <https://api.prefect.io/graphql>\n\n
The following error messages were provided by the GraphQL server:\n\n
INTERNAL_SERVER_ERROR: Variable "$input" got invalid value null at\n
"input.logs[0].flow_run_id"; Expected non-nullable type UUID! not to be null.\n
INTERNAL_SERVER_ERROR: Variable "$input" got invalid value null at\n "input.logs[2].flow_run_id"; Expected non-nullable type UUID! not to be null.\n
INTERNAL_SERVER_ERROR: Variable "$input" got invalid value null at\n "input.logs[4].flow_run_id"; Expected non-nullable type UUID! not to be null.\n
Chris White
Kevin Kho
Joseph Loss
05/03/2021, 8:19 PMJoseph Loss
05/03/2021, 8:20 PMJoseph Loss
05/03/2021, 8:23 PMJoseph Loss
05/03/2021, 8:24 PMKevin Kho
cloudpickle
. The connection would have to be made inside the mapped task like what you’re doing. What is the issue on the query side?Joseph Loss
05/03/2021, 10:34 PMeng_sra200 = pyodbc.connect('sra200')
@task(log_stdout=True)
def get_tracking_error(eng_sra200, data_datetime, date_next_bus, backfill):
if backfill:
run_date = date_next_bus
else:
run_date = data_datetime
query = """
SELECT accnt, strategyLevel, trackingError / 10000 AS 'trackingError'
FROM sradb.tbltrackingerrorticker_v3
WHERE portfolioType = 'accnt-stratLevel'
and DATE = '%s'
GROUP BY accnt, strategyLevel
""" % run_date.strftime('%Y-%m-%d')
return pd.read_sql(query, eng_sra200)
So I was trying to come up with a way that, for functions that call multiple DSN sources, to automate so that I wouldn't have to do these edits in a dozen functions haha