howardyoo commented on code in PR #40802: URL: https://github.com/apache/airflow/pull/40802#discussion_r1683584650
########## airflow/traces/utils.py: ########## @@ -40,26 +40,32 @@ def _gen_id(seeds: list[str], as_int: bool = False, type: int = TRACE_ID) -> str def gen_trace_id(dag_run: DagRun, as_int: bool = False) -> str | int: + if dag_run.start_date is None: + return 1 Review Comment: > If this is the answer to my above question about why we are checking if it is `1`, then I definitely feel this is the wrong option to hardcode the literal integer. Either use something like ArgNotSet or create a constant with a name like `NO_TRACE_ID = 1` and use that everywhere. I agree. I would define a constant of NO_TRACE_ID and use it instead. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
