Skip to content

Commit 933261c

Browse files
committed
PR comments
1 parent f236d32 commit 933261c

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

mkdocs/docs/contributing.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,22 @@ To rebuild the containers from scratch.
159159

160160
PyIceberg supports the ability to run our catalog tests against an arbitrary REST Catalog.
161161

162-
To do so, run the catalog integration tests with the `PYICEBERG_REST_CATALOG_PROPERTIES` environment variable.
162+
You can set the test catalog in the ~/.pyiceberg.yaml file:
163163

164-
```sh
165-
PYICEBERG_REST_CATALOG_PROPERTIES='{"uri": "http://localhost:8181"}' poetry run pytest tests/integration/
164+
```yaml
165+
catalog:
166+
test_catalog:
167+
uri: http://rest-catalog/ws/
168+
credential: t-1234:secret
166169
```
167170
168-
`PYICEBERG_REST_CATALOG_PROPERTIES` should be a JSON-encoded string that contains any [catalog properties](https://py.iceberg.apache.org/configuration/#rest-catalog) necessary to interact with your REST Catalog implementation.
171+
You can additionally set the properties using environment variables
172+
173+
```sh
174+
export PYICEBERG_CATALOG__TEST_CATALOG__URI=thrift://localhost:9083
175+
export PYICEBERG_CATALOG__TEST_CATALOG__ACCESS_KEY_ID=username
176+
export PYICEBERG_CATALOG__TEST_CATALOG__SECRET_ACCESS_KEY=password
177+
```
169178

170179
## Code standards
171180

tests/integration/test_catalog.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
import json
1918
import os
2019
from pathlib import Path, PosixPath
2120
from typing import Generator, List
@@ -77,17 +76,13 @@ def rest_catalog() -> Generator[Catalog, None, None]:
7776

7877

7978
@pytest.fixture(scope="function")
80-
def rest_catalog_env() -> Generator[Catalog, None, None]:
81-
if properties_json := os.environ.get("PYICEBERG_REST_CATALOG_PROPERTIES"):
82-
properties = json.loads(properties_json)
83-
test_catalog = RestCatalog(
84-
"rest_env",
85-
**properties,
86-
)
79+
def test_catalog() -> Generator[Catalog, None, None]:
80+
if test_catalog_name := os.environ.get("PYICEBERG_TEST_CATALOG"):
81+
test_catalog = RestCatalog(test_catalog_name)
8782
yield test_catalog
8883
clean_up(test_catalog)
8984
else:
90-
pytest.skip("REST catalog environment variables not set")
85+
pytest.skip("Test catalog environment variables not set")
9186

9287

9388
@pytest.fixture(scope="function")
@@ -111,7 +106,7 @@ def hive_catalog() -> Generator[Catalog, None, None]:
111106
pytest.lazy_fixture("sqlite_catalog_file"),
112107
pytest.lazy_fixture("rest_catalog"),
113108
pytest.lazy_fixture("hive_catalog"),
114-
pytest.lazy_fixture("rest_catalog_env"),
109+
pytest.lazy_fixture("test_catalog"),
115110
]
116111

117112

0 commit comments

Comments
 (0)