potiuk commented on PR #29395:
URL: https://github.com/apache/airflow/pull/29395#issuecomment-1421405239

   Also tested the client API:
   
   ```python
   import datetime
   
   import airflow_client.client
   from pprint import pprint
   from airflow_client.client.api import dag_run_api
   
   #
   # In case of the basic authentication below. Make sure:
   #  - Airflow is configured with the basic_auth as backend:
   #     auth_backend = airflow.api.auth.backend.basic_auth
   #  - Make sure that the client has been generated with securitySchema Basic.
   
   # Configure HTTP basic authorization: Basic
   configuration = airflow_client.client.Configuration(
       host="http://localhost:8080/api/v1";,
       username='admin',
       password='admin'
   )
   
   # Enter a context with an instance of the API client
   with airflow_client.client.ApiClient(configuration) as api_client:
       # Create an instance of the API class
       api_instance = dag_run_api.DAGRunApi(api_client)
   
       try:
           # Get current configuration
           api_response = 
api_instance.get_dag_runs(dag_id='example_params_ui_tutorial',
                                                    
start_date_lte=datetime.datetime.now(
               tz=datetime.timezone.utc))
           pprint(api_response)
       except airflow_client.client.ApiException as e:
           print("Exception when calling ConfigApi->get_config: %s\n" % e)
   ```
   
   Results in no warnings and properly formatted params:
   
   
![image](https://user-images.githubusercontent.com/595491/217357747-b2b3e0d3-c342-4b4d-8737-61fffe036f31.png)
   
   When we remove timezone it correctly fails:
   
   
![image](https://user-images.githubusercontent.com/595491/217357857-f53a36b5-cc76-42eb-b1ad-8951636cbc6e.png)
   
   And we get this as response:
   
   
![image](https://user-images.githubusercontent.com/595491/217358047-f7c590dd-7fee-48a3-8fd0-e7a767ee4003.png)
   
   So it looks like everything works as expected. Even if the last one (no 
timezone failure) might be not the same as before, this is a **proper** 
behaviour - due to ambiguity of  no-timezone query
   
   
   


-- 
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]

Reply via email to