niraj-mx07 opened a new pull request, #12197:
URL: https://github.com/apache/gravitino/pull/12197

   ### What changes were proposed in this pull request?
   
   1. Updated `AuditDTO` to use `datetime` instead of `str` for `_create_time` 
and `_last_modified_time`.
   2. Configured custom `decoder` and `encoder` functions in `dataclasses_json` 
metadata to properly parse the ISO-8601 strings into `datetime` objects.
   3. Updated the return types of `create_time()` and `last_modified_time()` 
methods to properly return `datetime`.
   4. Modified python unit tests that incorrectly tested for strings to compare 
against `datetime` objects.
   
   ### Why are the changes needed?
   
   The python client's `AuditDTO` was failing to deserialize `datetime` fields 
from JSON, keeping them as raw ISO-8601 strings (and marked with `TODO: Can't 
deserialized datetime from JSON`). This violated the `Audit` interface, which 
defines `create_time()` and `last_modified_time()` to return `datetime` 
objects. This change fixes the type mismatch at runtime.
   
   Fix: #12196
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, `AuditDTO.create_time()` and `AuditDTO.last_modified_time()` in the 
Python client will now correctly return `datetime` objects instead of strings, 
aligning with the expected interface.
   
   ### How was this patch tested?
   
   - Ran and updated existing python unit tests (`test_relational_table.py`, 
`test_table_dto.py`, `test_responses.py`) which now correctly assert against 
`datetime` objects.
   


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