SEPURI-SAI-KRISHNA commented on PR #45083:
URL: https://github.com/apache/superset/pull/45083#issuecomment-6542385369

   Resolved on the shape you gave, keyed by target since a rename means the two
   names differ:
   
   ```python
   for source, target in overwritten.items():
       try:
           _base_df.loc[:, [target]] = append_df[[source]].rename(
               columns={source: target}
           )
       except TypeError:
           _base_df[target] = append_df[source]
   ```
   
   The added `rename` is free. Against master's loop on the five same-name 
shapes
   (lossless float into int64, NaN into int64, float into float, int into int,
   fractional float into int64) both forms take the same branch and return equal
   frames. The swap, the plain append and three MultiIndex shapes are right too.
   
   You were right that the bulk set breaks wider than NaN alone. Six of eight
   cases raise under it, plain `{"y": "y"}` included.
   
   Added `test_append_columns_widens_an_int_target_the_new_values_do_not_fit` 
for
   the fallback: an int `z`, a NaN in the source, reached through a rename, 
which
   is the path only this PR creates. 215 pass in the directory, pre-commit 
clean.
   
   Re-censused against the new base: 13 conditions, 12 fail a named test when
   reverted on their own. The thirteenth is the list-wrap on the write target,
   which no reachable input separates. Only a tuple-keyed mapping would, and
   `validate_column_args` matches keys against level 0 on a MultiIndex frame, so
   one cannot arrive. On a real pivot cross product the two forms are identical,
   and `rolling` with `{"sum_m": "sum_n"}` over one comes out correct.
   


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

  • Re: [PR] fix(post-proces... SEPURI-SAI-KRISHNA (via GitHub) via notifications

Reply via email to