PyCQA / redbaron

Bottom-up approach to refactoring in python
http://redbaron.pycqa.org/
694 stars 74 forks source link

Failure on Pandas DataFrame.set_index() #166

Open zgoda-mobica opened 6 years ago

zgoda-mobica commented 6 years ago

Code:

df = DataFrame.from_dict(raw_results, orient='index')
df.set_index([[*range(len(df))]], inplace=True)

And result:

 232     df = DataFrame.from_dict(raw_results, orient='index')
 233     df.set_index([[*<---- here

The token STAR should be one of those: BACKQUOTE, BINARY, BINARY_RAW_STRING, BINARY_STRING, COMPLEX, FLOAT, FLOAT_EXPONANT, FLOAT_EXPONANT_COMPLEX, HEXA, INT, LAMBDA, LEFT_BRACKET, LEFT_PARENTHESIS, LEFT_SQUARE_BRACKET, LONG, MINUS, NAME, NOT, OCTA, PLUS, RAW_STRING, RIGHT_SQUARE_BRACKET, STRING, TILDE, UNICODE_RAW_STRING, UNICODE_STRING

It is not normal that you see this error, it means that Baron has failed to parse valid Python code. It would be kind if you can extract the snippet of your code that makes Baron fail and open a bug here: https://github.com/Psycojoker/baron/issues

Sorry for the inconvenience.

Psycojoker commented 6 years ago

Thanks for reporting. This is due to the used of a currently unsupported python3 grammar (the "*" in a [] or more exactly on an atom). This will end up being solved at some point.