I encountered encoding error while testing Cube Core and trying to load my manifest.json from file. My manifest.json file was utf-8 encoded, which caused UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10168:.
Python version 3.9 which Cube Core docker image is using defaults to locale.getprefferedencoding(), which seems to be ascii on the docker image of Cube Core.
Added numpy docstring for from_file() and from_url() methods
Added possibility to set desired encoding for a local file. It not set, defaults to locale.getpreferredencoding()
Example of usage with Dbt.from_file():
from cube_dbt import Dbt
# with utf-8 encoding
dbt = Dbt.from_file("path/to/manifest.json", encoding="utf-8").filter(paths=["marts/"])
# without specifying encoding
dbt = Dbt.from_file("path/to/manifest.json").filter(paths=["marts/"])
Not needed in from_url() method because urlopen uses Content-Type headers to set encoding.
** new PR from new branch to prevent too many file edits
I encountered encoding error while testing Cube Core and trying to load my manifest.json from file. My manifest.json file was utf-8 encoded, which caused
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10168:
.Python version 3.9 which Cube Core docker image is using defaults to locale.getprefferedencoding(), which seems to be ascii on the docker image of Cube Core.
Example of usage with Dbt.from_file():
Not needed in from_url() method because urlopen uses Content-Type headers to set encoding.
** new PR from new branch to prevent too many file edits