False-positive DeprecationWarning
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza con kiota_abstractions.default_query_parameters.py y reproduce la advertencia usando el comando de importación de Python proporcionado. Comprueba cómo las clases de request-builder obsoletas emiten advertencias durante la definición de la clase y, después, verifica que importar ClassesRequestBuilder no produzca ninguna advertencia, mientras que instanciar una clase obsoleta siga produciendo una advertencia.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
Simply just importing one of the class request builders is enough to trigger a deprecation warnings. The reproduction steps below will output 3 different deprecation warnings, even though the deprecated classes are not being used.
This is because the warnings are in the class scope, so will be ran at "compile" time.
Changing the first example to the second will only warn when the dataclass is instantiated.
# kiota_abstractions.default_query_parameters.py
@dataclass
class GetQueryParameters(QueryParameters):
"""
Default placeholder class for query parameters.
"""
warn("GetQueryParameters is deprecated. Use QueryParameters instead.", DeprecationWarning)
# kiota_abstractions.default_query_parameters.py
@dataclass
class GetQueryParameters(QueryParameters):
"""
Default placeholder class for query parameters.
"""
def __init__(self, *args, **kwargs):
warn("GetQueryParameters is deprecated. Use QueryParameters instead.", DeprecationWarning)
super().__init__(*args, **kwargs)
Expected behavior
Deprecation warnings are only raised when you instantiate a deprecated class I.E. are actually using it, not just importing it.
How to reproduce
python -Wd -c "from msgraph.generated.education.classes.classes_request_builder import ClassesRequestBuilder"
SDK Version
1.12.0
Latest version known to work for scenario above?
No response
Known Workarounds
Only workaround is to suppress deprecation warnings from this library.
import warnings
warnings.filterwarnings("ignore", module="msgraph", category=DeprecationWarning)
warnings.filterwarnings(
"ignore",
module="kiota_abstractions",
category=DeprecationWarning,
)
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- Lenguaje dominante
- Python
- Estrellas
- 634
- Forks
- 100
- Merge medio
- 23 h 18 min
- PR fusionados (30 d)
- 7
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoftgraph/msgraph-sdk-python
-
status:waiting-for-triage type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
microsoftgraph/msgraph-sdk-python#1628 ·
Los mantenedores suelen responder en 1 día
-
status:waiting-for-triage type:bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
microsoftgraph/msgraph-sdk-python#1570 ·
Los mantenedores suelen responder en 1 día
-
status:waiting-for-triage type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoftgraph/msgraph-sdk-python#1563 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
kiota-dom-export.txt is large and included in the released packagePosiblemente ocupada @Fryguy la tomó hace 184 días. AbiertoNeeds: Attention :wave: type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
microsoftgraph/msgraph-sdk-python#1287 · 3 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
status:waiting-for-triage type:feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
microsoftgraph/msgraph-sdk-python#1596 ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoftgraph/msgraph-sdk-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
trycua/hermes-cua-spaces#17 ·
-
area:codegen backend:hip bug direction:output good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
nautechsystems/nautilus_trader#5718 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: reme CLI crashes when the running server used a relative config pathPosiblemente ocupada @nurlanmnn la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
agentscope-ai/ReMe#770 ·
Los mantenedores suelen responder en 1 día
-
Pi: paused model calls are reported as "not signed in" when the model's provider comes from an extensionPosiblemente ocupada @balcsida la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
microsoft/TokenEconomizer#288 ·
Los mantenedores suelen responder en 1 día