mistercrunch opened a new pull request #8658: fix: handle duplicate groupby keys
URL: https://github.com/apache/incubator-superset/pull/8658
 
 
   ### CATEGORY
   
   Choose one: bugfix
   
   ### SUMMARY
   In a bubble chart, when picking the same `Series` and `Entity` against 
postgres, pandas chokes on something related to having a duplicate column name 
(`SELECT foo, foo FROM bar`)
   
   <img width="1030" alt="Screen Shot 2019-11-25 at 9 55 25 PM" 
src="https://user-images.githubusercontent.com/487433/69603084-6fb47b00-0fce-11ea-834d-5ba6b142c47c.png";>
   
   stacktrace:
   ```
   Traceback (most recent call last):
     File 
"/Users/maximebeauchemin/code/superset/superset/connectors/sqla/models.py", 
line 999, in query
       df = self.database.get_df(sql, self.schema, mutator)
     File "/Users/maximebeauchemin/code/superset/superset/models/core.py", line 
992, in get_df
       if v.type == numpy.object_ and needs_conversion(df[k]):
     File "/Users/maximebeauchemin/code/superset/superset/models/core.py", line 
963, in needs_conversion
       return not df_series.empty and isinstance(df_series[0], (list, dict))
     File 
"/Users/maximebeauchemin/code/superset/env/lib/python3.6/site-packages/pandas/core/frame.py",
 line 2927, in __getitem__
       indexer = self.columns.get_loc(key)
     File 
"/Users/maximebeauchemin/code/superset/env/lib/python3.6/site-packages/pandas/core/indexes/base.py",
 line 2657, in get_loc
       return self._engine.get_loc(key)
     File "pandas/_libs/index.pyx", line 108, in 
pandas._libs.index.IndexEngine.get_loc
     File "pandas/_libs/index.pyx", line 127, in 
pandas._libs.index.IndexEngine.get_loc
     File "pandas/_libs/index.pyx", line 142, in 
pandas._libs.index.IndexEngine._get_loc_duplicates
   TypeError: '<' not supported between instances of 'str' and 'int'
   
   This addresses the issue by preventing dups in selects/groupby altogether
   ```
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the 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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to