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

   ### SUMMARY
   While creating a Java Client from the the Superset OpenAPI spec with the 
OpenAPI codegen, a collision between the `changedOn` and `changed_on` 
properties in the SQL Lab `QueryRestultSchema` caused an error. This happened 
because it automatically converts the snake_case property to a camelCase one. 
This type of overlap doesn't exist in other schemas. Checking the other 
schemas, all the other ones are of type `fields.DateTime`, except `SliceSchema` 
and `ChartEntityResponseSchema`, which were `fields.String`. For this reason, 
the redundant `changedOn` property was removed, and the type of `changed_on` 
was updated to `DateTime` for `QueryResultSchema`, `SliceSchema` and 
`ChartEntityResponseSchema`.
   
   Furthermore, when looking at the Redux code, I noticed inconsistencies in 
the test fixtures + the reducer:
   - The `SouthPane` test didn't have `changed_on` in the fixture, only 
`changedOn`. Furthermore, the type was wrong - the fixture had an epoch, while 
the value is in fact an ISO8601 string (see screenshot).  These were updated.
   - The `SqlLab` fixture also showed the `changedOn` property as an epoch. 
However, the `changed_on` property there was in correct format, i.e. ISO-8601 
string. To comply with the updated schema, `changedOn` was removed.
   - the SQL Lab reducer was comparing the ISO-8601 string value of `changedOn` 
with an epoch-valued `queriesLastUpdate`. I'm not sure what kind of results 
that resulted in, but to fix this, we now refer to `changed_on`, and convert it 
to epoch format first before doing the comparison.
   
   ### SCREENSHOTS
   Currently on master, the values of `changedOn` and `changed_on` are 
identical in the query response:
   
![image](https://github.com/apache/superset/assets/33317356/ba5df2b0-bb96-4f48-8df0-869f642f86c1)
   
   Notice how `queriesLastUpdate` is an epoch, but `changedOn` which it's being 
compared to in the reducer is an ISO-8601 string?
   
![image](https://github.com/apache/superset/assets/33317356/5ed2943a-b211-4fc9-91cf-65a0451cc829)
   
![image](https://github.com/apache/superset/assets/33317356/0713b926-364b-4578-9860-f4919e58e7bf)
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] 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
   


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