rusackas opened a new pull request, #44904:
URL: https://github.com/apache/superset/pull/44904

   ### SUMMARY
   #44720 fixed `CrateEngineSpec.fetch_data` to decode TIMESTAMP columns via 
`cursor._result["col_types"]`, working around the fact that crate-python's 
DBAPI `cursor.description` always reports `type_code=None` (confirmed directly 
by reading `crate.client.cursor.Cursor.description`: it hardcodes `None` for 
every description slot except the column name). The only coverage that landed 
with that fix was unit tests mocking `cursor._result` directly — which would 
never notice if a future crate-python release renamed or restructured that 
private attribute, since the mock would keep "working" regardless of what the 
real driver actually does.
   
   This adds a testcontainers case that creates a real table with both 
`TIMESTAMP WITHOUT TIME ZONE` and `TIMESTAMP WITH TIME ZONE` columns (type 
codes 15 and 11 respectively, per `crate.client.converter.DataType` — confirmed 
against the installed `crate` package), inserts epoch-millisecond values, and 
runs `fetch_data` against the real raw DBAPI cursor from a live query, 
asserting both decode to the correct `datetime`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A — test-only change.
   
   ### TESTING INSTRUCTIONS
   CI's `Testcontainers` workflow runs this against a real `crate/crate` 
container (amd64-only, so it won't run under Docker-on-Apple-Silicon locally — 
see the file's own docstring). To run manually on an x86_64 host with Docker:
   ```bash
   pytest tests/testcontainers/db_engine_specs/test_crate.py -m testcontainers 
-v
   ```
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to