Unable to ignore shared_with DeprecatedWarning
- Lingua principale
- Python
- Stelle
- 2.2k
- Fork
- 1.2k
- Merge medio
- 2h 40m
- PR unite (30g)
- 2
Descrizione
**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](https://github.com/Esri/arcgis-python-api/issues/2335).) 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:
```python
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:
```python
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
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.