bcdata 0.12.1__tar.gz → 0.12.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bcdata-0.12.1 → bcdata-0.12.2}/CHANGES.txt +4 -0
- {bcdata-0.12.1/bcdata.egg-info → bcdata-0.12.2}/PKG-INFO +1 -1
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata/__init__.py +1 -1
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata/bcdc.py +17 -8
- {bcdata-0.12.1 → bcdata-0.12.2/bcdata.egg-info}/PKG-INFO +1 -1
- {bcdata-0.12.1 → bcdata-0.12.2}/tests/test_bcdc.py +8 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/LICENSE.txt +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/README.md +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata/bc2pg.py +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata/cli.py +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata/database.py +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata/wcs.py +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata/wfs.py +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata.egg-info/SOURCES.txt +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata.egg-info/dependency_links.txt +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata.egg-info/entry_points.txt +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata.egg-info/not-zip-safe +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata.egg-info/requires.txt +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/bcdata.egg-info/top_level.txt +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/pyproject.toml +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/requirements.txt +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/setup.cfg +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/setup.py +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/tests/test_bc2pg.py +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/tests/test_cli.py +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/tests/test_wcs.py +0 -0
- {bcdata-0.12.1 → bcdata-0.12.2}/tests/test_wfs.py +0 -0
|
@@ -104,14 +104,23 @@ def get_table_definition(table_name):
|
|
|
104
104
|
table_definition["description"] = result["notes"]
|
|
105
105
|
# iterate through resources associated with each package
|
|
106
106
|
for resource in result["resources"]:
|
|
107
|
-
#
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
#
|
|
113
|
-
if
|
|
114
|
-
|
|
107
|
+
# only examine geographic resources with object name key
|
|
108
|
+
if (
|
|
109
|
+
"object_name" in resource.keys()
|
|
110
|
+
and resource["bcdc_type"] == "geographic"
|
|
111
|
+
):
|
|
112
|
+
# confirm that object name matches table name and schema is present
|
|
113
|
+
if (
|
|
114
|
+
resource["object_name"] == table_name
|
|
115
|
+
and "details" in resource.keys()
|
|
116
|
+
and resource["details"] != ""
|
|
117
|
+
):
|
|
118
|
+
table_definition["schema"] = json.loads(resource["details"])
|
|
119
|
+
# look for comments only if details/schema was found
|
|
120
|
+
if "object_table_comments" in resource.keys():
|
|
121
|
+
table_definition["comments"] = resource[
|
|
122
|
+
"object_table_comments"
|
|
123
|
+
]
|
|
115
124
|
|
|
116
125
|
if not table_definition["schema"]:
|
|
117
126
|
log.warning(
|
|
@@ -2,6 +2,7 @@ import json
|
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
|
|
5
|
+
import bcdata
|
|
5
6
|
from bcdata import bcdc
|
|
6
7
|
|
|
7
8
|
AIRPORTS_PACKAGE = "bc-airports"
|
|
@@ -40,6 +41,13 @@ def test_get_table_definition_format_multi():
|
|
|
40
41
|
assert table_definition["description"]
|
|
41
42
|
assert table_definition["comments"]
|
|
42
43
|
assert table_definition["schema"]
|
|
44
|
+
columns = [c["column_name"] for c in table_definition["schema"]]
|
|
45
|
+
assert (
|
|
46
|
+
bcdata.primary_keys[
|
|
47
|
+
"whse_forest_vegetation.ogsr_priority_def_area_cur_sp"
|
|
48
|
+
].upper()
|
|
49
|
+
in columns
|
|
50
|
+
)
|
|
43
51
|
|
|
44
52
|
|
|
45
53
|
def test_get_table_definition_format_multi_nopreview():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|