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

[PR] fix(models): use Series.iloc for positional access in post_process_df [superset]

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

   ### What was the deprecation warning?
   
   ```
   FutureWarning: Series.__getitem__ treating keys as positions is deprecated.
   In a future version, integer keys will always be treated as labels
   (consistent with DataFrame behavior). To access a value by position,
   use `ser.iloc[pos]`
   ```
   
   Fired from `superset/models/core.py` in `Database.post_process_df`. The
   inner helper `column_needs_conversion` used `df_series[0]` to peek at the
   first element. When the Series index doesn't contain `0` as a label (e.g.
   after a filter like `df[df.col > value]`), pandas raises this FutureWarning
   and will raise a `KeyError` in a future pandas version.
   
   ### What was changed?
   
   `df_series[0]` β†’ `df_series.iloc[0]` in `post_process_df`.
   
   `iloc` is unconditionally positional β€” it always means "first element"
   regardless of the index labels.
   
   ### No behavior change
   
   The empty-check (`not df_series.empty`) guards against `IndexError` on
   `.iloc[0]`. The conversion logic is unchanged; only the access method
   corrects the deprecation.
   
   ### Test plan
   
   - Added `test_post_process_df_non_zero_based_index` in
     `tests/unit_tests/models/core_test.py`. Constructs a DataFrame with a
     non-zero-based index (by filtering rows so index is `[1, 2]` not `[0, 1,
     2]`) and asserts `post_process_df` correctly JSON-serializes list columns.
   - `pytest tests/unit_tests/models/core_test.py::test_post_process_df_non_zero_based_index`


-- 
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(models): use Series.iloc for positional access in post_process_df [superset]

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

   ### <span aria-hidden="true">βœ…</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">πŸ”¨</span> Latest commit | 3ef23992fa22d97f5bd998f0ad11ab2a5be15677 |
   |<span aria-hidden="true">πŸ”</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a3ab113c96a190008fe2b90 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-41344--superset-docs-preview.netlify.app](https://deploy-preview-41344--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">πŸ“±</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQxMzQ0LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.FdLqVQxLS1YKMjFuff1khquWShrM1AJIaDUPmzGv7RA)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">πŸ€–</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DctBCoQwDADAv-S8ZVsLYvcHPiONEQPVlMaDIv59e5vLPFCb7vWEH8AHcsODtu5Vrq9xEzYnRclVNTlFDywOidjMkTbuY-Fa9J6XfkaMmEOIlEYMyXs_rTzk5OH9Aw) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-41344--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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(models): use Series.iloc for positional access in post_process_df [superset]

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

   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(models): use Series.iloc for positional access in post_process_df [superset]

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

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/41344?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 55.62%. Comparing base ([`449bd69`](https://app.codecov.io/gh/apache/superset/commit/449bd69802daa9da96f40938f429b4a6ff7b8aa7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3ef2399`](https://app.codecov.io/gh/apache/superset/commit/3ef23992fa22d97f5bd998f0ad11ab2a5be15677?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 39 commits behind head on master.
   > :exclamation:  There is a different number of reports uploaded between BASE (449bd69) and HEAD (3ef2399). Click for more details.
   > 
   > <details><summary>HEAD has 6 uploads less than BASE</summary>
   >
   >| Flag | BASE (449bd69) | HEAD (3ef2399) |
   >|------|------|------|
   >|python|8|2|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #41344      +/-   ##
   ==========================================
   - Coverage   64.34%   55.62%   -8.73%     
   ==========================================
     Files        2653     2653              
     Lines      144970   145033      +63     
     Branches    33453    33463      +10     
   ==========================================
   - Hits        93287    80674   -12613     
   - Misses      50000    63623   +13623     
   + Partials     1683      736     -947     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/41344/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/41344/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.27% <ΓΈ> (-0.02%)` | :arrow_down: |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/41344/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/41344/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/41344/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.86% <ΓΈ> (-0.02%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/41344/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.92% <ΓΈ> (-18.61%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/41344/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/41344/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/41344?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(models): use Series.iloc for positional access in post_process_df [superset]

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


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