From c648a8c3bdf5e027e151ddecbae560995b15a248 Mon Sep 17 00:00:00 2001 From: NANAE AUBRY Date: Wed, 23 Oct 2024 11:12:25 +0200 Subject: [PATCH 1/3] Fix overwrite sample --- .../05_content_publishers/overwriting_feature_layers.ipynb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/05_content_publishers/overwriting_feature_layers.ipynb b/samples/05_content_publishers/overwriting_feature_layers.ipynb index 14a48aabdd..e3e9d5cedd 100644 --- a/samples/05_content_publishers/overwriting_feature_layers.ipynb +++ b/samples/05_content_publishers/overwriting_feature_layers.ipynb @@ -330,7 +330,8 @@ "source": [ "# add the csv as an item\n", "item_prop = {'title':'USA Capitals spreadsheet_' + str(now)}\n", - "csv_item = gis.content.add(item_properties=item_prop, data=my_csv)\n", + "root_folder = gis.content.folders.get()\n", + "csv_item = root_folder.add(item_properties=item_prop, file=my_csv)\n", "csv_item" ] }, @@ -474,7 +475,7 @@ "metadata": {}, "outputs": [], "source": [ - "map1.add_layer(cities_item)" + "map1.content.add(cities_item)" ] }, { @@ -978,7 +979,7 @@ "metadata": {}, "outputs": [], "source": [ - "map2.add_layer(cities_item)" + "map2.content.add(cities_item)" ] }, { From ce75219334b17fb25e4ede8afe19923cbbe8a83e Mon Sep 17 00:00:00 2001 From: NANAE AUBRY Date: Thu, 24 Oct 2024 17:03:26 +0200 Subject: [PATCH 2/3] update add --- .../05_content_publishers/overwriting_feature_layers.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/05_content_publishers/overwriting_feature_layers.ipynb b/samples/05_content_publishers/overwriting_feature_layers.ipynb index e3e9d5cedd..3aacf863a3 100644 --- a/samples/05_content_publishers/overwriting_feature_layers.ipynb +++ b/samples/05_content_publishers/overwriting_feature_layers.ipynb @@ -329,9 +329,9 @@ ], "source": [ "# add the csv as an item\n", - "item_prop = {'title':'USA Capitals spreadsheet_' + str(now)}\n", + "item_prop = {'title':'USA Capitals spreadsheet_' + str(now), \"item_type\": \"CSV\"}\n", "root_folder = gis.content.folders.get()\n", - "csv_item = root_folder.add(item_properties=item_prop, file=my_csv)\n", + "csv_item = root_folder.add(item_properties=item_prop, file=my_csv).result()\n", "csv_item" ] }, From 33cb659c413e063e4d9acfb94d0770c3f9d43bec Mon Sep 17 00:00:00 2001 From: Shuang Song <103439749+cariashuang0417@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:04:16 -0400 Subject: [PATCH 3/3] type --- .../overwriting_feature_layers.ipynb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/samples/05_content_publishers/overwriting_feature_layers.ipynb b/samples/05_content_publishers/overwriting_feature_layers.ipynb index 3aacf863a3..0b477baf98 100644 --- a/samples/05_content_publishers/overwriting_feature_layers.ipynb +++ b/samples/05_content_publishers/overwriting_feature_layers.ipynb @@ -329,7 +329,7 @@ ], "source": [ "# add the csv as an item\n", - "item_prop = {'title':'USA Capitals spreadsheet_' + str(now), \"item_type\": \"CSV\"}\n", + "item_prop = {'title':'USA Capitals spreadsheet_' + str(now), \"type\": \"CSV\"}\n", "root_folder = gis.content.folders.get()\n", "csv_item = root_folder.add(item_properties=item_prop, file=my_csv).result()\n", "csv_item" @@ -906,7 +906,10 @@ { "cell_type": "markdown", "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "source": [ "### Access the overwritten feature layer\n", @@ -1019,7 +1022,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.18" + "version": "3.11.0" }, "toc": { "base_numbering": 1, @@ -1036,5 +1039,5 @@ } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 }