GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — `DataFrame.to_gbq` with `if_exists="replace"` and `clustering_columns` can swap data between columns if order is different · Issue #2502 · google/bigframes Closed Labels api: bigqueryIssues related to the googleapis/python-bigquery-dataframes API. DescriptionEnvironment detailsSteps to reproduce
Code exampleimport bigframes.pandas as bpd import pandas as pd TABLE_ID = "my_project.my_dataset.test_table" df = pd.DataFrame( {"a": [10, 1, 2], "b": ["Justin", "Alex", "Jim"], "c": ["cat", "dog", "cat"]} ) bdf = bpd.DataFrame(df) # First time writing, all good bdf.to_gbq(TABLE_ID, clustering_columns=["b"]) # Reorder the clustered column b and column c bdf = bdf[["a", "c", "b"]] # When replacing and writing, the b and c columns are swapped bdf.to_gbq(TABLE_ID, if_exists="replace", clustering_columns=["b"]) While the dataframe looks good, the updated table now has columns b/c data swapped:
This doesn't happen if Reacted by Chelsea Lin Activity
MetadataMetadataAssigneesLabelsapi: bigqueryIssues related to the googleapis/python-bigquery-dataframes API. TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |