Seemingly reversed dict for table names
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #212 来自 @JHON12091986 —— 已关闭,未合并
评估
调研方向
Start by reading the XarrayContext.from_dataset implementation and its tests for table_names; the issue’s example shows the current mapping and the expected mapping, with names as keys and dimension tuples as values. Check how era5.surface is resolved in the example, then add or update a focused test to define the expected behavior. Done when the mapping works as shown in the issue and the relevant tests pass.
由索引模型根据 Issue 内容生成。
描述
import xarray as xr
import xarray_sql as xql
# Open ARCO-ERA5 — a weather dataset with 273 variables since 1940.
# Turning off dask means we don't have to wait to construct a task graph.
ds = xr.open_zarr(
'gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3',
chunks=None, # Turn dask off
storage_options={'token': 'anon'} # Anonymous read from the public GCS bucket — no auth required.
)
ctx = xql.XarrayContext()
# Make sure to pass `chunks`!
ctx.from_dataset('era5', ds, chunks=dict(time=6), table_names={
('time', 'latitude', 'longitude'): 'surface',
('time', 'level', 'latitude', 'longitude'): 'atmosphere',
})
To my surprise, the table_name is the value instead of the key! I would've expected this:
import xarray as xr
import xarray_sql as xql
# Open ARCO-ERA5 — a weather dataset with 273 variables since 1940.
# Turning off dask means we don't have to wait to construct a task graph.
ds = xr.open_zarr(
'gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3',
chunks=None, # Turn dask off
storage_options={'token': 'anon'} # Anonymous read from the public GCS bucket — no auth required.
)
ctx = xql.XarrayContext()
# Make sure to pass `chunks`!
ctx = ctx.from_dataset('era5', ds, chunks=dict(time=6), table_names={
'surface': ('time', 'latitude', 'longitude'),
'atmosphere': ('time', 'level', 'latitude', 'longitude'),
})
ctx.sql("SELECT * FROM era5.surface LIMIT 5")
String -> Tuple
- 主要语言
- Python
- 星标
- 142
- 派生
- 19
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
xqlsystems/xarray-sql 的其他 Issue
-
documentation
难度 1/5 1-3 小时 新手友好度 85/100
xqlsystems/xarray-sql#268 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 64/100
xqlsystems/xarray-sql#267 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 74/100
xqlsystems/xarray-sql#243 ·
维护者通常 1 天内回复
-
publish.yml: the TestPyPI verification step is unreachable (and installs the wrong package name)未关闭
难度 2/5 1-3 小时 新手友好度 62/100
xqlsystems/xarray-sql#242 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
xqlsystems/xarray-sql#237 ·
维护者通常 1 天内回复
查看 xqlsystems/xarray-sql 的全部 Issue
相似的 Issue
-
debt
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/vscode-flake8#601 ·
维护者通常 1 天内回复
-
nonews refactor
难度 2/5 1-3 小时 新手友好度 75/100
Uninett/nav#4255 · 1 条评论 · 1 个 reaction ·
维护者通常 3 天内回复
-
namespace operations
难度 1/5 1 小时以内 新手友好度 70/100
EclipseFdn/open-vsx.org#14421 ·
维护者通常 1 天内回复
-
untriaged
难度 2/5 1-3 小时 新手友好度 78/100
ubuntu/ubuntu-project-docs#850 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复