Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the CI #279

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tests/catalog/test_dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from typing import Any, Dict, List
from typing import List
from unittest import mock

import boto3
import pytest
from moto import mock_dynamodb
from unittest import mock

from pyiceberg.catalog import METADATA_LOCATION, TABLE_TYPE
from pyiceberg.catalog.dynamodb import (
ACTIVE,
DYNAMODB_COL_CREATED_AT,
DYNAMODB_COL_IDENTIFIER,
DYNAMODB_COL_NAMESPACE,
DYNAMODB_TABLE_NAME_DEFAULT,
ACTIVE,
DynamoDbCatalog,
_add_property_prefix,
)
Expand Down Expand Up @@ -57,6 +57,7 @@ def test_create_dynamodb_catalog_with_table_name(_dynamodb, _bucket_initialize:
assert response["Table"]["TableName"] == custom_table_name
assert response["Table"]["TableStatus"] == ACTIVE


@mock_dynamodb
def test_create_table_with_database_location(
_bucket_initialize: None, moto_endpoint_url: str, table_schema_nested: Schema, database_name: str, table_name: str
Expand Down Expand Up @@ -510,6 +511,7 @@ def test_update_namespace_properties_overlap_update_removal(_bucket_initialize:
# should not modify the properties
assert test_catalog.load_namespace_properties(database_name) == test_properties


def test_passing_provided_profile() -> None:
catalog_name = "test_ddb_catalog"
session_props = {
Expand All @@ -518,10 +520,10 @@ def test_passing_provided_profile() -> None:
"aws_session_token": "ghi",
"region_name": "eu-central-1",
"botocore_session": None,
"profile_name": None
"profile_name": None,
}
props = {"py-io-impl": "pyiceberg.io.fsspec.FsspecFileIO"}
props.update(session_props)
props.update(session_props) # type: ignore
with mock.patch('boto3.Session', return_value=mock.Mock()) as mock_session:
mock_client = mock.Mock()
mock_session.return_value.client.return_value = mock_client
Expand Down