junqilv commented on PR #99: URL: https://github.com/apache/airflow-client-python/pull/99#issuecomment-1780957830
My test steps are as follows: First, when I tried to pass data in datetime format to logical_date, I found that the http request returned showed that the format of logical_date was incorrect. ![image](https://github.com/apache/airflow-client-python/assets/72023608/775492c8-d8f4-408a-8dd4-627b05547e70) The logical_date displayed in the Stable REST API is "logical_date": "2019-08-24T14:15:22Z", that is, ("%Y-%m-%dT%H:%M:%SZ") format. ![image](https://github.com/apache/airflow-client-python/assets/72023608/d730af8b-7600-4093-80ae-f0aa5c386dc0) So I tried to use logical_date = "2019-08-24T14:15:22Z" directly, which is a parameter in the string format that meets the rest api requirements, but the function directly threw an exception, as shown in the figure, Then I found that airflow-client limits the type of logical_date to [datetime, none_type]. ![image](https://github.com/apache/airflow-client-python/assets/72023608/2ba6d704-4bc0-42aa-9854-37440d4b0e3c) So I am stuck in a loop. If I pass in data in datetime format, the function sanitize_for_serialization will convert it into a string that does not conform to the stable REST API format, causing the request to fail. If a string such as logical_date = "2019-08-24T14:15:22Z" is passed in, the type check of the function parameters will fail. So I think there are two approaches that can be taken. The first is to change the way the function sanitize_for_serialization handles logical_date, and the second is to allow strings like "2019-08-24T14:15:22Z" to be passed in to logical_date. The first method is the simplest because it only requires modifying one line of code. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org