Allow custom drivers and pin types
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- backend-api-design
Rechercherichtung
Beginne damit, die bestehenden Einstiegspunkte pin_read, pin_write, pin_upload und pin_download sowie die Behandlung der offiziell unterstützten Treiber zu lesen. Vergleiche, wie Typen und Metadaten derzeit verteilt werden, und prüfe anschließend den verknüpften lazyscribe-Handler und das Einstiegspunktbeispiel auf relevante Einschränkungen. Die Aufgabe ist erfüllt, wenn benutzerdefinierte Treiber benutzerdefinierten Typen zugeordnet und über die Schnittstellen pin_read und pin_write verwendet werden können.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I'm looking at using pins to version various model assets, but one of the pain points I'm running into is custom drivers for reading and writing. Many of our model artifacts are serialized to YAML or ONNX or a custom serialization, but there's no driver for those. There's friction too if we wanted, say a polars driver to read a csv or parquet directly into polars.
This leaves pin_upload and pin_download, which while workable, doesn't provide the same level of integration as pin_read and pin_write. If you use a user-defined helper with pin_download to read a custom type, then users have to know in advance to use that helper, versus just board.pin_read(name) for officially supported types.
For example, to show the difference in experience between a csv file and yaml:
import pandas as pd
import yaml
from pins import board_temp
board = board_temp()
data = pd.DataFrame({"a": [1,2,3]})
board.pin_write(data, "pandas_data", type="csv")
with open("data.yml", "w") as f:
yaml.dump({"a": [1,2,3]}, f)
board.pin_upload("data.yml", name="yaml_data")
# Reading
pandas_data_read = board.pin_read("pandas_data")
yaml_path = board.pin_download("yaml_data")[0]
with open(yaml_path) as f:
yaml_data_read = yaml.safe_load(f)
# Using helper
def pin_read_yaml(board, *args, **kwargs):
yaml_path = board.pin_download(*args, **kwargs)[0]
with open(yaml_path) as f:
return yaml.safe_load(f)
yaml_helper_read = pin_read_yaml(board, "yaml_data") # need to know in advance to use yaml, not just pin_read(name)
Optimally, I want to be able to specify custom types that are associated with custom drivers. The custom type would be written to data.txt, which would allow for dispatching to the associated driver on pin_read like is done for officially supported types, without needing to know in advance to use a user-defined helper.
I'm also seeing similarities between this problem and "dynamic artifact handling" in another library we work on (lazyscribe/lazyscribe#56), where we used handler classes and entrypoints to allow users to define custom artifact serializers/deserializers.
Anyway, please let me know if I'm missing anything here and what you think!
- Vorherrschende Sprache
- Python
- Sterne
- 59
- Forks
- 11
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus rstudio/pins-python
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
rstudio/pins-python#367 ·
-
.maint
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
rstudio/pins-python#280 ·
-
testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
rstudio/pins-python#196 ·
-
.enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
rstudio/pins-python#363 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 55/100
rstudio/pins-python#354 ·
Alle Issues in rstudio/pins-python
Ähnliche Issues
-
docs(contributing): the two things that silently block a PREvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenavailable documentation good first issue
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 95/100
Nixitov/Riptide-Native#944 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
JTHCode/secretguard#24 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: middleware documentation good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainer antworten meist innerhalb von 1 Tag