-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
Standard methods to suppress the shared_with deprecation warning do not work. When working with many items, the warnings make monitoring progress impossible, as things like tqdm progress bars or other desired output get pushed out of view.
I need to use shared_with, instead of Item.sharing, until the performance of the latter is improved (see enhancement request Improve performance of SharingManager.) I'm working with tens-of-thousands of items in a large organization, and the performance difference of shared_with's hundreds-of-milliseconds vs Item.Sharing's seconds, prevents me from using the latter.
To Reproduce
Steps to reproduce the behavior:
import arcgis
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning, module="arcgis")
gis = arcgis.GIS("home")
# Insert the Item ID of some item you own that is shared with at least one group.
item = gis.content.get('item_id')
# Trigger the DeprecatedWarning for shared_with
print(item.shared_with)
error:
DeprecatedWarning: shared_with is deprecated as of 2.3.0 and has been removed in 3.0.0. Use `Item.sharing` instead.
print(item.shared_with)
Expected behavior
I would like to suppress this warning so that it doesn't interfere with my expected output.
Platform (please complete the following information):
- Windows 11
- Chrome
- Python API Version 2.4.1