Skip to content

Commit

Permalink
Move test script to test directory
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaub committed Dec 8, 2022
1 parent d73fa35 commit 3217216
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 676 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ jobs:
geoparquet_validator $example || exit 1;
done
- name: Test json schema
run: |
python -m pip install pytest
cd tests
pytest test_json_schema.py -v
test-json-metadata:
runs-on: ubuntu-latest
steps:
Expand All @@ -56,6 +50,7 @@ jobs:
- name: Run scripts
run: |
cd scripts
poetry run pytest test_json_schema.py -v
poetry run python generate_example.py
poetry run python update_example_schemas.py
cd ../examples
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Ignore GeoPackage file used in conversion to GeoParquet
*.gpkg*
tests/data/*
/scripts/data/
/scripts/__pycache__/
15 changes: 2 additions & 13 deletions format-specs/geoparquet.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,12 @@ All file-level metadata should be included under the `geo` key in the parquet me

| Field Name | Type | Description |
| ------------------ | ------ | -------------------------------------------------------------------- |
| version | string | **REQUIRED.** The version of the GeoParquet metadata standard used when writing. |
| primary_column | string | **REQUIRED.** The name of the "primary" geometry column. |
| version | string | **REQUIRED.** The version identifier for the GeoParquet specification. |
| primary_column | string | **REQUIRED.** The name of the "primary" geometry column. In cases where a GeoParquet file contains multiple geometry columns, the primary geometry may be used by default in geospatial operations. |
| columns | object\<string, [Column Metadata](#column-metadata)> | **REQUIRED.** Metadata about geometry columns. Each key is the name of a geometry column in the table. |

At this level, additional implementation-specific fields (e.g. library name) are allowed, and thus readers should be robust in ignoring those.

### Additional file metadata information

#### primary_column

This indicates the "primary" or "active" geometry for systems that can store multiple geometries,
but have a default geometry used for geospatial operations.

#### version

Version of the GeoParquet spec used, currently 0.5.0-dev

### Column metadata

Each geometry column in the dataset must be included in the columns field above with the following content, keyed by the column name:
Expand Down
8 changes: 8 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ poetry run python generate_example.py

Using `poetry run` ensures that you're running the python script using _this_ local environment, not your global environment.

### Tests

To run the tests, change into the `scripts` directory and run the following:

```
poetry run pytest test_json_schema.py -v
```

### example.parquet

The `example.parquet` file in the `examples` directory is generated with the `generate_example.py` script. This script needs to be updated and run any time there are changes to the "geo" file metadata or to the version constant in `schema.json`.
Expand Down
Loading

0 comments on commit 3217216

Please sign in to comment.