Skip to content

Commit 85dc168

Browse files
committed
Add warning in docs
1 parent d0da977 commit 85dc168

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

mkdocs/docs/contributing.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,18 @@ To rebuild the containers from scratch.
157157

158158
#### Running Integration Tests against REST Catalogs
159159

160+
!!! warning "Do not run against production catalogs"
161+
The integration tests will delete data throughout the entirety of your catalog. Running these integration tests against production catalogs will result in data loss.
162+
160163
PyIceberg supports the ability to run our catalog tests against an arbitrary REST Catalog.
161164

162-
You can set the test catalog in the ~/.pyiceberg.yaml file:
165+
In order to run the test catalog, you will need to specify which REST catalog to run against with the `PYICEBERG_TEST_CATALOG` environment variable
166+
167+
```sh
168+
export PYICEBERG_TEST_CATALOG=test_catalog
169+
```
170+
171+
The catalog in question can be configured either through the ~/.pyiceberg.yaml file or through environment variables.
163172

164173
```yaml
165174
catalog:
@@ -168,8 +177,6 @@ catalog:
168177
credential: t-1234:secret
169178
```
170179
171-
You can additionally set the properties using environment variables
172-
173180
```sh
174181
export PYICEBERG_CATALOG__TEST_CATALOG__URI=thrift://localhost:9083
175182
export PYICEBERG_CATALOG__TEST_CATALOG__ACCESS_KEY_ID=username

tests/integration/test_catalog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import pytest
2323

24-
from pyiceberg.catalog import Catalog, MetastoreCatalog
24+
from pyiceberg.catalog import Catalog, MetastoreCatalog, load_catalog
2525
from pyiceberg.catalog.hive import HiveCatalog
2626
from pyiceberg.catalog.memory import InMemoryCatalog
2727
from pyiceberg.catalog.rest import RestCatalog
@@ -78,7 +78,7 @@ def rest_catalog() -> Generator[Catalog, None, None]:
7878
@pytest.fixture(scope="function")
7979
def test_catalog() -> Generator[Catalog, None, None]:
8080
if test_catalog_name := os.environ.get("PYICEBERG_TEST_CATALOG"):
81-
test_catalog = RestCatalog(test_catalog_name)
81+
test_catalog = load_catalog(test_catalog_name)
8282
yield test_catalog
8383
clean_up(test_catalog)
8484
else:

0 commit comments

Comments
 (0)