Comments (2)
If by design, duplicate column names are allowable in Snowpark's API, then I think we should allow a way for the user to edit column names which are duplicated.
Example:
duplicated_col | duplicated_col |
---|---|
'some-value' | 'some-value-2' |
should be able to be changed to:
new_col_name_1 | new_col_name_2 |
---|---|
'some-value' | 'some-value-2' |
Instead of just throwing the error you showed.
from snowpark-python.
Hello @suenalaba, Sry If I was not clear. By definition we cannot create a snowpark dataframe with ambigious column names but we can create a snowpark dataframe that has two columns with same name but different case (i.e)
Name of column 1 - "Snow Flake"
Name of column 2 - "SNOW FLAKE"
Example dataframe :-
When we try to rename Column - 1 (i.e) "Snow Flake" to "Snow Flake Renamed" using the below command
df.with_column_renamed('"Snow Flake"','"Snow Flake Renamed"').show()
we run into an exception -> SnowparkColumnException: Unable to rename the column "Snow Flake" as "Snow Flake Renamed" because this DataFrame has 2 columns named "Snow Flake".
This is because, in the current implementation, the with_column_renamed method, the column being renamed is converted to upper case and then it is checked if there are any more columns with same name, In our case, we have a column that matches upper("Snow Flake") in snowpark dataframe and hence we run into this exception. I've addressed this in my PR #1149
from snowpark-python.
Related Issues (20)
- SNOW-1247349: Add a function to test for DataFrames equality HOT 4
- SNOW-1269037: NaT (Not a Time) not parsed as NULL when `session.create_dataframe` (throws exception instead) HOT 7
- SNOW-1282839: Add support for SnowURLs HOT 2
- SNOW-1292271: Add required alias for appName HOT 1
- SNOW-1296838: Links to source code in Snowpark docs are broken HOT 1
- SNOW-1304211: Pylance throws errors when using `copy_options` with `copy_into_location` method
- SNOW-1306306: `DataFrame.cache_result()` type hinting HOT 1
- SNOW-1331246: Hashlib type hints breaks snowpark for python 3.9 HOT 2
- SNOW-1335071: add method DataFrame.transform HOT 1
- SNOW-1348700: Error on .filter for specific filters HOT 1
- SNOW-1348838: issues relating to FIELD_OPTIONALLY_ENCLOSED_BY HOT 1
- SNOW-1355930: Support functions.any_value
- SNOW-1358494: Pandas Replace on Copy of DataFrame has No Effect HOT 1
- SNOW-1358930: fix_drift_between_column_sf_type_and_dtype maps DecimalType to Int64
- SNOW-1358946: Support Interval expression in Local Testing HOT 1
- SNOW-1359104: [Local testing] Column alias incorrectly changes column name in resulting schema HOT 2
- SNOW-1359450: Suport ASOF join HOT 1
- SNOW-1360263: row_number window function raises a ValueError (index is not in list)
- SNOW-1367643: When/Otherwise throws a KeyError depending on the order of the select vs where clause
- SNOW-1368516: Creating a dataframe from pandas dataframe with datetime objects fail to set the right column type HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snowpark-python.