Skip to content

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

@oriolbx

Description

@oriolbx

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions