Add resolved_kwargs to data_saver and data_loader tags

オープン
#1,136 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 8 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

hamilton/function_modifiers/adapters.py の578行目付近から始め、次に examples/parallelism/star_counting/run.py を実行し、dr.list_available_variables() と as_dict() を通じてノードタグを調べます。data_saver タグと data_loader タグの両方について resolved_kwargs がどのように生成されるかを確認します。完了条件は、データフローが実行される前に解決済みパスがメタデータに表示されることです。

索引モデルが issue の本文から書いたものです。

説明

Is your feature request related to a problem? Please describe.
When I have a built dataflow I would like to be able to see which paths are entered in @load_from and @save_to.

Describe the solution you'd like
After executing the dataflow I can see the paths in the results, but I'd like to be able to see them without executing the dataflow.

Some metadata is already being written to tags: https://github.com/DAGWorks-Inc/hamilton/blob/main/hamilton/function_modifiers/adapters.py#L578

I tested adding the following line there:

                "hamilton.data_saver.kwargs": resolved_kwargs,

Then I tried running examples/parallelism/star_counting/run.py with the dr.execute statement replaced by:

    node = next(
        node for node in dr.list_available_variables() if node.name == "save.unique_stargazers"
    )
    print(node.as_dict()["tags"])

This gives the output I was hoping for:

{'hamilton.data_saver': True, 'hamilton.data_saver.sink': 'csv', 'hamilton.data_saver.classname': 'PandasCSVWriter', 'hamilton.data_saver.kwargs': {'path': 'unique_stargazers.csv'}}

Describe alternatives you've considered
Maybe a custom DataLoader and DataSaver that store the arguments they were initiated with?

主要言語
Jupyter Notebook
スター
2.6k
フォーク
228
平均マージ
10日 7時間
マージ済み PR(30日)
18

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/hamilton のほかの issue

apache/hamilton の issue をすべて見る

似ている issue

Data Engineering の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。