-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python3.8 support issue #27
Comments
I tried to use the ast in the link you shared. But I am still getting issues with
When trying over parsing the code py_code = """pandas.read('file.csv', n_rows=100)""" The error is listed in detail as follows. ---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-28-f8e859182bac> in <module>
9
10 # convert the python AST into general-purpose ASDL AST used by tranX
---> 11 asdl_ast = python_ast_to_asdl_ast(py_ast.body[0], grammar)
12 print('String representation of the ASDL AST: \n%s' % asdl_ast.to_string())
13 print('Size of the AST: %d' % asdl_ast.size)
~/Data2/en_nlp/Text2SQL/code/asdl/lang/py/py_asdl_helper.py in python_ast_to_asdl_ast(py_ast_node, grammar)
40 if field_value is not None: # sometimes it could be 0
41 if grammar.is_composite_type(field.type):
---> 42 child_node = python_ast_to_asdl_ast(field_value, grammar)
43 asdl_field.add_value(child_node)
44 else:
~/Data2/en_nlp/Text2SQL/code/asdl/lang/py/py_asdl_helper.py in python_ast_to_asdl_ast(py_ast_node, grammar)
48 if grammar.is_composite_type(field.type):
49 for val in field_value:
---> 50 child_node = python_ast_to_asdl_ast(val, grammar)
51 asdl_field.add_value(child_node)
52 else:
~/Data2/en_nlp/Text2SQL/code/asdl/lang/py/py_asdl_helper.py in python_ast_to_asdl_ast(py_ast_node, grammar)
31 # assert py_node_name.startswith('_ast.')
32
---> 33 production = grammar.get_prod_by_ctr_name(py_node_name)
34
35 fields = []
~/Data2/en_nlp/Text2SQL/code/asdl/asdl.py in get_prod_by_ctr_name(self, name)
48
49 def get_prod_by_ctr_name(self, name):
---> 50 return self._constructor_production_map[name]
51
52 @property
KeyError: 'keyword' |
Have you solved this problem? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In python3.8 ast package has change that make asdl can‘t work normally.
Because of:
https://docs.python.org/3.8/library/ast.html#
Do you have plans to support such changes in python3.8? If not, I will use a lower version of python. Thank you!
The text was updated successfully, but these errors were encountered: