Replace a dataset on a map, updating the visualization with the data from the new dataset. You can use this feature to apply a dataset with similar data on top of an existing project, visualizing the dataset with the existing map configuration. Alternatively, you can combine this function with copy_map
to use a map as a template, allowing you to create several new projects from a single map and several similar datasets.
Warning! By default, this function expects a dataset with a compatible schema. At minimum, any columns used by map layers etc must be present and of the same type. For managed and hextile datasets,
replace_dataset
will check the schemas and will error if the new dataset is not compatible with the old one. To override the error, setforce = True
. To use strict type checking between fields, setstrict=True
. For other types of dataset, replacing a dataset with another one with an incompatible schema might cause your map's layers, filters, charts, etc to fail to render.