Esri / Esri/arcgis-python-api

Unable to ignore shared_with DeprecatedWarning

Aperta
#2,342 3 commenti 0 reazioni 1 assegnatario Rivendicata da @achapkowski Vedi su GitHub
bug help wanted question
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.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.