[Python] Support operator `%` on Array/Scalar
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
- 67/100
Línea de trabajo
Lee las implementaciones de los operadores de Python para Array y Scalar y el stub de anotaciones array.pyi mencionado en el issue; compara cómo los operadores existentes llaman a kernels con comprobación. Añade compatibilidad con % usando el kernel existente modulo_checked y actualiza el alias del stub. Se considerará terminado cuando la expresión de Array/scalar indicada funcione con el módulo con redondeo hacia abajo propio de Python y las anotaciones incluyan __mod__.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the enhancement requested
Arithmetic and bitwise operators to Array and Scalar were added in
- #48085
This was a separate follow-up: #49606
But%wasn't added as there was no kernel at that time.
import pyarrow as pa
pa.array([9,-9]) % 3
Traceback (most recent call last):
File "<python-input-1>", line 1, in <module>
pa.array([9,-9]) % 3
~~~~~~~~~~~~~~~~~^~~
TypeError: unsupported operand type(s) for %: 'pyarrow.lib.Int64Array' and 'int'
Now that modulo / modulo_checked exist since #46901 (floored like Python's %) the implementation of __mod__ could call modulo_checked - similar to other operators calling their own checked kernels.
[!NOTE]
if implemented, the annotation stubs will need__mod__added as well (per current state of #55264 as one more alias line in array.pyi__mod__ = __add__)
(and%may be re-added where just removed in #55654)
Component(s)
Python
- Lenguaje dominante
- C++
- Estrellas
- 17.3k
- Forks
- 4.5k
- Merge medio
- 3 d 14 h
- PR fusionados (30 d)
- 90
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una 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 apache/arrow
-
[R] abandon_ship() looks up `call` with an inheriting get(), so its "no call" guard never firesPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. AbiertoComponent: R
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
[C++][Python][Docs] Some compute functions are missing from the docsPosiblemente ocupada @rajbhatt2406-collab la tomó hace 1 día. AbiertoComponent: C++ Component: Documentation Component: Python
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/arrow#55762 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Component: C++ Type: enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Component: C++ Type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Component: Continuous Integration Component: Developer Tools Type: enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
apache/arrow#55672 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/arrow
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
Los mantenedores suelen responder en 2 días
-
Missing repro Platform: Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
software-mansion/react-native-reanimated#11554 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Niko1221/Strata#7211 · 3 comentarios ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sleepyviper1213/redis#52 ·