Expose Python UDF inlining as a public, reusable extension codec
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 48/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Domaine
- backend-api-design
Piste de recherche
Commencez par crates/core/src/codec.rs et les points d’entrée PythonLogicalCodec, PythonPhysicalCodec et SessionContext.with_python_udf_inlining. Lisez la dépendance #1703 et les changements de composition des codecs de #1678 avant de déterminer comment le codec public doit être installé dans la chaîne. Le travail est terminé lorsque des consommateurs Rust externes peuvent ajouter le codec public et préserver le format filaire Python UDF existant sans réimplémenter le cadrage de son payload.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
datafusion-python can serialize a Python scalar UDF inline, by cloudpickling the function together with its schemas and volatility, so a plan referencing a Python UDF round-trips into a process that does not have that function registered. This is what SessionContext.with_python_udf_inlining turns on.
That capability is not reachable from outside the crate. PythonFunctionScalarUDF is pub(crate), and encode_python_scalar_udf / decode_python_scalar_udf in crates/core/src/codec.rs are private; only the try_encode_python_scalar_udf / try_decode_python_scalar_udf wrappers are pub(crate), and they are called from the two codecs this crate installs on every session. A Rust project that already has its own physical extension codec, and wants Python UDFs to travel through it, has to reimplement the cloudpickle framing to stay wire-compatible. Requested in https://github.com/apache/datafusion-python/pull/1678#pullrequestreview-5100366976.
Describe the solution you'd like
Extract the inlining behavior into its own LogicalExtensionCodec / PhysicalExtensionCodec implementation and make that type public, rather than exporting two free functions and a struct. Since #1678 made codecs compose, with_python_udf_inlining can then install that codec into the chain instead of being a flag consulted inside PythonLogicalCodec and PythonPhysicalCodec, and an outside consumer can put the same type in its own chain and get the same wire format for free. Suggested independently in https://github.com/apache/datafusion-python/pull/1678#discussion_r3918287124.
A public codec is a better thing to commit to than the current internals. It hides the payload layout, which is versioned and should stay free to change, and it exposes the behavior at the granularity DataFusion already understands.
Describe alternatives you've considered
Marking the existing functions and PythonFunctionScalarUDF pub as they stand. Smaller, but it publishes the payload layout as API, and it does not compose with anything — a caller still has to decide where in its own codec to call them.
Additional context
Depends on #1703, gating pyo3/extension-module, since the crate cannot currently be linked as a plain Rust dependency. Follow-up from #1678.
- Langage dominant
- Python
- Étoiles
- 605
- Forks
- 176
- Merge moyen
- 1 j 23 h
- PR mergées (30 j)
- 8
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/datafusion-python
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
apache/datafusion-python#1757 ·
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
apache/datafusion-python#1726 ·
-
Difficulté 2/5 Une demi-journée Accessibilité débutants 88/100
apache/datafusion-python#1691 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/datafusion-python#1644 ·
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
apache/datafusion-python#1737 ·
Toutes les issues de apache/datafusion-python
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
huggingface/Repo2RLEnv#163 · 1 commentaire ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
NousResearch/hermes-agent#121143 ·