Azure / Azure/MachineLearningNotebooks
Azure wrongly reads Parquet
未關閉
還沒有人認領這個 Issue。
- 主要語言
- Jupyter Notebook
- 星號
- 4.4k
- 分支
- 2.6k
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Setup
Python=3.8 + azureml-core=1.36.0 + azureml-dataprep=2.26.0 + pyarrow=7.0.0 + pandas=1.4
Summary
to_pandas_dataframe wrongly reads certain Parquet datasets. Data of some columns appears to be internally shuffled.
This was already reported but closed without a fix, due to issues with sharing data publicly.
I share the reproducible example below
How to reproduce
from azureml.core import Workspace, Dataset
import tempfile
import pandas as pd
# prepare data: list of sha-values with some None values
df = pd.read_csv('error_data.csv')
# configure Azure storage
ws = Workspace.from_config()
dstore = ws.datastores.get('your datastore')
dstore_path = 'relative datastore path'
target = (dstore,dstore_path)
# write to Azure storage
with tempfile.TemporaryDirectory() as tmpdir:
df.to_parquet(f'{tmpdir}/df.parquet')
ds=Dataset.File.upload_directory(tmpdir,target,overwrite=True)
# read by two ways: download and open in pandas or use the Azure connector
with tempfile.TemporaryDirectory() as tmpdir:
ds=Dataset.File.from_files(target)
ds.download(tmpdir)
df1 = pd.read_parquet(tmpdir)
ds = Dataset.Tabular.from_parquet_files(target)
df2 = ds.to_pandas_dataframe()
# comparison fails, the data seems displaced :-(
pd.testing.assert_frame_equal(df1,df2)
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 issue 中的可重現範例開始,將下載的 pandas DataFrame 與 Dataset.Tabular.from_parquet_files(...).to_pandas_dataframe() 進行比較。追蹤 Azure Dataset 的表格式 Parquet 讀取路徑,然後使用提供的 error_data.csv,透過 pd.testing.assert_frame_equal(df1, df2) 驗證完成情況。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- azure, pandas, python
- 領域
- cloud, data-engineering
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100