Skip to content
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

NameError: name 'null' is not defined in get_card_data if chosen format is json #20

Closed
chlebovec opened this issue Jul 16, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@chlebovec
Copy link

I am getting error when trying to use method get_card_data with chosing data format 'json'

Traceback (most recent call last): File "<input>", line 1, in <module> File "/usr/local/lib/python3.9/site-packages/metabase_api/metabase_api.py", line 837, in get_card_data return eval(res.text) File "<string>", line 2, in <module> NameError: name 'null' is not defined

Seems like eval() does not like 'null', maybe using of json.loads() instead could help.

@vvaezian vvaezian added the bug Something isn't working label Jul 16, 2021
@vvaezian
Copy link
Owner

@chlebovec Thanks for the bug report. I'll fix it soon.

@vvaezian
Copy link
Owner

Fixed in 0.2.12

@chlebovec
Copy link
Author

@vvaezian there is the same problem with 'true' and 'false' (with lowercase letters at the beginning)... why dont you use json.loads() instead of replacing?

@vvaezian vvaezian reopened this Jul 27, 2021
@vvaezian
Copy link
Owner

vvaezian commented Aug 3, 2021

@chlebovec Thanks for the suggestion. json.loads() is now used (v.0.2.13).

@vvaezian vvaezian closed this as completed Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants