PyCQA/redbaron

Failure on Pandas DataFrame.set_index()

zgoda-mobica opened this issue · 1 comments

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.

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.