bcgov / bcgov/bcdata_py

bc2pg - improve type mapping

未关闭
#204 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
32
派生
7
平均合并
12 分钟
30 天内合并 PR
14

描述

As per #178, `bc2pg` creates `numeric` postgres columns for BCDC `NUMBER` columns.

Should `bcdata` :

- automatically inspect the data to determine if it is integer and adjust the type accordingly?
- accept an optional field map argument for overriding the BCDC types, maybe something like `{"field_name1": "numeric", "field_name2": "integer"}`?
- parse the `data_precision` part of the schema?

As data are read by geopandas when writing to postgres:

- if providing a mapping, easiest would be to use sqlalchemy types: https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.to_postgis.html
- if running the type optimization automatically, pandas has a method: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.convert_dtypes.html

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。