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

KeyError: 'sizeX' #41

Closed
ccalby opened this issue Jan 14, 2023 · 4 comments
Closed

KeyError: 'sizeX' #41

ccalby opened this issue Jan 14, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ccalby
Copy link

ccalby commented Jan 14, 2023

When running the mb.copy_collection command,

Copying the dashboard "Report" ...
Traceback (most recent call last):
File "/root/./copy_metabase_reports.py", line 5, in
mb.copy_collection(source_collection_id=5, destination_parent_collection_id=11, deepcopy_dashboards=True, verbose=True)
File "/usr/local/lib/python3.10/dist-packages/metabase_api/metabase_api.py", line 931, in copy_collection
self.copy_dashboard(source_dashboard_id=dashboard_id,
File "/usr/local/lib/python3.10/dist-packages/metabase_api/metabase_api.py", line 838, in copy_dashboard
card_json[prop] = card[prop]
KeyError: 'sizeX'
root@localhost:~#

{ "browser-info": { "language": "en-GB", "platform": "Win32", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", "vendor": "Google Inc." }, "system-info": { "file.encoding": "UTF-8", "java.runtime.name": "OpenJDK Runtime Environment", "java.runtime.version": "11.0.17+8", "java.vendor": "Eclipse Adoptium", "java.vendor.url": "https://adoptium.net/", "java.version": "11.0.17", "java.vm.name": "OpenJDK 64-Bit Server VM", "java.vm.version": "11.0.17+8", "os.name": "Linux", "os.version": "5.15.0-56-generic", "user.language": "en", "user.timezone": "GMT" }, "metabase-info": { "databases": [ "h2", "mysql" ], "hosting-env": "unknown", "application-database": "mysql", "application-database-details": { "database": { "name": "MySQL", "version": "8.0.31-0ubuntu0.22.04.1" }, "jdbc-driver": { "name": "MariaDB Connector/J", "version": "2.7.6" } }, "run-mode": "prod", "version": { "date": "2022-12-07", "tag": "v0.45.1", "branch": "release-x.45.x", "hash": "019d31c" }, "settings": { "report-timezone": null } } }

@vvaezian
Copy link
Owner

Hi @ccalby. This error is due to a change introduced in v.45 of Metabase.
I'll fix this for the Python wrapper once the version v.45.2 of Metabase is released (as it fixes quite a few issues).
In the meantime, to fix the error on your end, you can replace sizeX and sizeY in the source code with size_x and size_y.

@vvaezian vvaezian added the bug Something isn't working label Jan 14, 2023
@vvaezian vvaezian self-assigned this Jan 14, 2023
vvaezian added a commit that referenced this issue Jan 17, 2023
@noahtf13
Copy link

Is this fixed? I'm still getting the issue. Thanks for the hard work @vvaezian

vvaezian added a commit that referenced this issue Feb 1, 2023
@vvaezian
Copy link
Owner

vvaezian commented Feb 1, 2023

Fixed in version 0.2.16.

@vvaezian vvaezian closed this as completed Feb 1, 2023
@noahtf13
Copy link

noahtf13 commented Feb 1, 2023

Amazing, thank you!

mazzma12 added a commit to mazzma12/metabase_api_python that referenced this issue Mar 1, 2024
* Create stale.yml

* Update stale.yml

* Update python-package.yml

* Update test_metabase_api.py

* Update test_metabase_api.py

* Update stale.yml

* Update stale.yml

* Update python-package.yml

* Rename python-package.yml to test.yml

* Update test.yml

* Update test.yml

* Update stale.yml

* Update setup.py

* fix issue vvaezian#41

* Update CHANGELOG.md

* Create readme.md

* Add files via upload

* Delete readme.md

* local test

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* local testing & code re-structuring

* update

* update

* update

* update

* Fix create_methods.py

* Update setup.py

* Bump Metabase test version

* improve testing

* Update stale.yml

---------

Co-authored-by: Vahid <vahid.vaezian@gmail.com>
Co-authored-by: Dynnammo <33259633+Dynnammo@users.noreply.github.com>
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

3 participants