You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "aminghadersohi (via GitHub)" <gi...@apache.org> on 2026/09/26 15:08:50 UTC

[PR] fix(elasticsearch): classify byte, short, half_float, scaled_float and unsigned_long columns [superset]

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

   ### SUMMARY
   Elasticsearch/OpenSearch columns can report the field types `BYTE`, `SHORT`, `HALF_FLOAT`, `SCALED_FLOAT` and `UNSIGNED_LONG` (the mapping type names; elasticsearch-dbapi reflects them this way in preset-io/elasticsearch-dbapi#126). None of Superset's default column type mappings match these names, so such dataset columns get no generic type and are not treated as numeric.
   
   This adds `column_type_mappings` for the five names to both `ElasticSearchEngineSpec` and `OpenDistroEngineSpec`:
   - `BYTE`, `SHORT` → `SmallInteger`, NUMERIC
   - `HALF_FLOAT`, `SCALED_FLOAT` → `Float`, NUMERIC
   - `UNSIGNED_LONG` → `BigInteger`, NUMERIC
   
   The names already covered by the defaults (`DOUBLE`, `FLOAT`, `INTEGER`, `LONG`, `BOOLEAN`, `DATETIME`, `STRING`) are unchanged.
   
   ### TESTING INSTRUCTIONS
   `pytest tests/unit_tests/db_engine_specs/test_elasticsearch.py`. The new parametrized `test_field_types_are_classified` covers both specs. Without the change, the 10 cases for the five new names fail; with it, all 49 tests in the file pass.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] 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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(elasticsearch): classify byte, short, half_float, scaled_float and unsigned_long columns [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on PR #44713:
URL: https://github.com/apache/superset/pull/44713#issuecomment-5903982339

   @rebenitez1802 since your approval: merged master and took your suggestion in b348178683. The patterns now anchor only at the start, like the defaults, and there's a `SCALED_FLOAT(100)` test case. I also updated the description to spell out the dependency on preset-io/elasticsearch-dbapi#126 (not yet released as 0.2.14), per EnxDev's note.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(elasticsearch): classify byte, short, half_float, scaled_float and unsigned_long columns [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on PR #44713:
URL: https://github.com/apache/superset/pull/44713#issuecomment-5904854141

   @rebenitez1802 merged master since your approval (fcd198fe2d). This was a test-only conflict: the new OpenSearch cursor tests and this PR's field-type tests are both kept, and all 57 Elasticsearch tests pass. No code changes.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(elasticsearch): classify byte, short, half_float, scaled_float and unsigned_long columns [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #44713:
URL: https://github.com/apache/superset/pull/44713


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(elasticsearch): classify byte, short, half_float, scaled_float and unsigned_long columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44713:
URL: https://github.com/apache/superset/pull/44713#issuecomment-5847340391

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(elasticsearch): classify byte, short, half_float, scaled_float and unsigned_long columns [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #44713:
URL: https://github.com/apache/superset/pull/44713#discussion_r4140687020


##########
superset/db_engine_specs/elasticsearch.py:
##########
@@ -31,12 +31,34 @@
     SupersetDBAPIOperationalError,
     SupersetDBAPIProgrammingError,
 )
+from superset.utils.core import GenericDataType
 
 if TYPE_CHECKING:
     from superset.models.core import Database
 
 logger = logging.getLogger()
 
+# Elasticsearch/OpenSearch field types that the default column type mappings
+# do not recognize. DOUBLE, FLOAT, INTEGER, LONG, BOOLEAN and DATETIME are
+# already covered by the defaults.
+FIELD_TYPE_MAPPINGS = (

Review Comment:
   Agreed that this depends on preset-io/elasticsearch-dbapi#126. It's merged, but 0.2.14 isn't on PyPI yet (latest is 0.2.13), so there's nothing to bump `requirements/*.txt` or the pyproject floor to. I've updated the description to state the dependency and that the change has no user-visible effect on 0.2.13. The mappings are harmless ahead of the release, and I'll bump the pin as soon as 0.2.14 is published. Leaving this open until then.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(elasticsearch): classify byte, short, half_float, scaled_float and unsigned_long columns [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #44713:
URL: https://github.com/apache/superset/pull/44713#issuecomment-5847372633

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/44713?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 56.14%. Comparing base ([`1a65f0e`](https://app.codecov.io/gh/apache/superset/commit/1a65f0ec9be22f4157f9e135254dda0b2a0ef83e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a54cf4f`](https://app.codecov.io/gh/apache/superset/commit/a54cf4f45d66a9e569033cf7b702494800e1a976?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   > :exclamation:  There is a different number of reports uploaded between BASE (1a65f0e) and HEAD (a54cf4f). Click for more details.
   > 
   > <details><summary>HEAD has 21 uploads less than BASE</summary>
   >
   >| Flag | BASE (1a65f0e) | HEAD (a54cf4f) |
   >|------|------|------|
   >|python|20|1|
   >|hive|3|1|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #44713       +/-   ##
   ===========================================
   - Coverage   81.12%   56.14%   -24.99%     
   ===========================================
     Files        2956     2956               
     Lines      178436   178440        +4     
     Branches    41341    41341               
   ===========================================
   - Hits       144764   100178    -44586     
   - Misses      30967    77743    +46776     
   + Partials     2705      519     -2186     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/44713/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/44713/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `36.78% <100.00%> (+<0.01%)` | :arrow_up: |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/44713/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/44713/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/44713/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/44713/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `36.78% <100.00%> (-48.63%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/44713/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/44713/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/44713?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(elasticsearch): classify byte, short, half_float, scaled_float and unsigned_long columns [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on code in PR #44713:
URL: https://github.com/apache/superset/pull/44713#discussion_r4137492700


##########
superset/db_engine_specs/elasticsearch.py:
##########
@@ -31,12 +31,34 @@
     SupersetDBAPIOperationalError,
     SupersetDBAPIProgrammingError,
 )
+from superset.utils.core import GenericDataType
 
 if TYPE_CHECKING:
     from superset.models.core import Database
 
 logger = logging.getLogger()
 
+# Elasticsearch/OpenSearch field types that the default column type mappings
+# do not recognize. DOUBLE, FLOAT, INTEGER, LONG, BOOLEAN and DATETIME are
+# already covered by the defaults.
+FIELD_TYPE_MAPPINGS = (

Review Comment:
   We pin elasticsearch-dbapi 0.2.13, and its `get_type` never returns these names. `byte`, `short`, `scaled_float` and `unsigned_long` aren't in its map, so they fall back to `String()`, and `half_float` comes back as a plain `Float`. On the current pin these columns show up as STRING (or FLOAT), so nothing here matches until preset-io/elasticsearch-dbapi#126 ships in 0.2.14, and that isn't tagged yet.
   
   Could we bump `requirements/*.txt` and the pyproject floor here once 0.2.14 is out, or at least say in the description that this depends on it? Otherwise people will upgrade expecting the fix and nothing will change.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(elasticsearch): classify byte, short, half_float, scaled_float and unsigned_long columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44713:
URL: https://github.com/apache/superset/pull/44713#issuecomment-5906350045

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers an incremental AI Review.
   - `/review full` - Manually triggers a full AI Review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(elasticsearch): classify byte, short, half_float, scaled_float and unsigned_long columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44713:
URL: https://github.com/apache/superset/pull/44713#issuecomment-5897200235

   <!-- Bito Reply -->
   The concern regarding the dependency on `elasticsearch-dbapi` version 0.2.14 is valid, as the current implementation in this PR relies on types that may not be correctly mapped in older versions. Since the PR introduces `FIELD_TYPE_MAPPINGS` to handle types like `byte`, `short`, `scaled_float`, `unsigned_long`, and `half_float`, it is appropriate to either update the dependency requirements or explicitly document this dependency in the PR description to ensure users are aware of the necessary version for these changes to take effect.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org