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

Import .carto file with create_vis parameter doesn't create a map #144

Open
oriolbx opened this issue Aug 8, 2019 · 1 comment
Open
Labels

Comments

@oriolbx
Copy link
Contributor

oriolbx commented Aug 8, 2019

Contect

  • Python SDK version: 1.6.0

According to the CARTO Import API documentation, in order to import a .carto file into CARTO, you have to add the parameter "create_vis=true".

When I try to import a carto file using the Python SDK using the parameter create_vis=True, CARTO is importing only the datasets but it is not creating the map:

dataset_manager = DatasetManager(auth_client)
for filename in glob.iglob('output/*.carto'):    
    # files = {'file': open(Path(filename), 'rb')}
    table = dataset_manager.create(filename, interval=None, create_vis=True)

However, if I call the CARTO Import API directly like this, the carto file is importing the datasets and it creates the map:

 r = requests.post('https://{username}.carto.com/api/v1/imports/?api_key={api}&create_vis=true'.format(username=new_username, api=api_key_new_username), files=files)

If I other parameters to set the different properties of the created dataset, for example to set the privacy of the dataset that is imported, CARTO creates the dataset properly:

dataset_manager = DatasetManager(auth_client)
for filename in glob.iglob('output/*.carto'):    
    # files = {'file': open(Path(filename), 'rb')}
    table = dataset_manager.create(filename, interval=None, privacy='link')

Is create_vis in the Python SDK the correct name of the parameter to create a map from a .carto file?

cc @oleurud

@alrocar
Copy link
Contributor

alrocar commented Aug 28, 2019

Removing from RT since seems minor (and there's a workaround).

Thanks for reporting!

@alrocar alrocar added the bug label Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants