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

Release 1.0.10 #72

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
Pipeline:
if: github.ref == 'refs/heads/main' || contains(github.ref, 'hotfix/')

runs-on: ubuntu-16.04
runs-on: ubuntu-22.04
container: quintoandar/python-3-7-java

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
Pipeline:
runs-on: ubuntu-16.04
runs-on: ubuntu-22.04
container: quintoandar/python-3-7-java

steps:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.

Preferably use **Added**, **Changed**, **Removed** and **Fixed** topics in each release or unreleased log for a better organization.

## [1.0.10](https://github.com/quintoandar/hive-metastore-client/releases/tag/1.0.10)
### Fixed
* Updated CI/CD runner
([#71](https://github.com/quintoandar/hive-metastore-client/pull/71))


## [1.0.9](https://github.com/quintoandar/hive-metastore-client/releases/tag/1.0.9)
### Fixed
* Stop inducing exception on Hive Metastore server when trying to retrieve partition values with `get_partition_values_from_table` for partitionless tables.
Expand Down
8 changes: 6 additions & 2 deletions examples/add_partitions_if_not_exists.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
# values should be passed in the same hierarchical order of the partitions
partition_list = [
PartitionBuilder(
values=["2020", "12", "13"], db_name=DATABASE_NAME, table_name=TABLE_NAME,
values=["2020", "12", "13"],
db_name=DATABASE_NAME,
table_name=TABLE_NAME,
).build(),
PartitionBuilder(
values=["2020", "12", "14"], db_name=DATABASE_NAME, table_name=TABLE_NAME,
values=["2020", "12", "14"],
db_name=DATABASE_NAME,
table_name=TABLE_NAME,
).build(),
]

Expand Down
8 changes: 6 additions & 2 deletions examples/add_partitions_to_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
# values should be passed in the same hierarchical order of the partitions
partition_list = [
PartitionBuilder(
values=["2020", "12", "16"], db_name=DATABASE_NAME, table_name=TABLE_NAME,
values=["2020", "12", "16"],
db_name=DATABASE_NAME,
table_name=TABLE_NAME,
).build(),
PartitionBuilder(
values=["2020", "12", "17"], db_name=DATABASE_NAME, table_name=TABLE_NAME,
values=["2020", "12", "17"],
db_name=DATABASE_NAME,
table_name=TABLE_NAME,
).build(),
]

Expand Down
4 changes: 3 additions & 1 deletion hive_metastore_client/hive_metastore_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ def get_partition_values_from_table(
if partition_keys:
partition_values_response = self.get_partition_values(
PartitionValuesRequest(
dbName=db_name, tblName=table_name, partitionKeys=partition_keys,
dbName=db_name,
tblName=table_name,
partitionKeys=partition_keys,
)
)
partitions = [
Expand Down
2 changes: 1 addition & 1 deletion requirements.lint.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==19.10b0
black==22.3.0
flake8==3.7.9
flake8-docstrings==1.5.0
mypy==0.782
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import find_packages, setup

__package_name__ = "hive_metastore_client"
__version__ = "1.0.9"
__version__ = "1.0.10"
__repository_url__ = "https://github.com/quintoandar/hive-metastore-client"

with open("requirements.txt") as f:
Expand Down
32 changes: 24 additions & 8 deletions tests/unit/hive_metastore_client/test_hive_metastore_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ def test_format_partitions_location(

@mock.patch.object(HiveMetastoreClient, "create_database")
def test_create_database_if_not_exists_with_nonexistent_database(
self, mocked_create_database, hive_metastore_client,
self,
mocked_create_database,
hive_metastore_client,
):
# arrange
mocked_database_obj = Mock()
Expand All @@ -393,7 +395,9 @@ def test_create_database_if_not_exists_with_nonexistent_database(

@mock.patch.object(HiveMetastoreClient, "create_database")
def test_create_database_if_not_exists_with_existent_database(
self, mocked_create_database, hive_metastore_client,
self,
mocked_create_database,
hive_metastore_client,
):
# arrange
mocked_database_obj = Mock()
Expand Down Expand Up @@ -427,7 +431,9 @@ def test_create_external_table(self, mocked_create_table, hive_metastore_client)

@mock.patch.object(HiveMetastoreClient, "get_table", return_value=None)
def test_get_partition_keys_objects_with_invalid_table(
self, mocked_get_table, hive_metastore_client,
self,
mocked_get_table,
hive_metastore_client,
):
# arrange
table_name = "table_name"
Expand All @@ -446,7 +452,9 @@ def test_get_partition_keys_objects_with_invalid_table(

@mock.patch.object(HiveMetastoreClient, "get_table")
def test_get_partition_keys_objects_with_not_partitioned_table(
self, mocked_get_table, hive_metastore_client,
self,
mocked_get_table,
hive_metastore_client,
):
# arrange
table_name = "table_name"
Expand All @@ -469,7 +477,9 @@ def test_get_partition_keys_objects_with_not_partitioned_table(

@mock.patch.object(HiveMetastoreClient, "get_table")
def test_get_partition_keys_objects_with_partitioned_table(
self, mocked_get_table, hive_metastore_client,
self,
mocked_get_table,
hive_metastore_client,
):
# arrange
table_name = "table_name"
Expand All @@ -495,7 +505,9 @@ def test_get_partition_keys_objects_with_partitioned_table(
HiveMetastoreClient, "get_partition_keys_objects", return_value=[]
)
def test_get_partition_keys_names_with_invalid_or_not_partitioned_table(
self, mocked_get_partition_keys_objects, hive_metastore_client,
self,
mocked_get_partition_keys_objects,
hive_metastore_client,
):
# arrange
table_name = "table_name"
Expand All @@ -516,7 +528,9 @@ def test_get_partition_keys_names_with_invalid_or_not_partitioned_table(
HiveMetastoreClient, "get_partition_keys_objects", return_value=[]
)
def test_get_partition_keys_names_with_partitioned_table(
self, mocked_get_partition_keys_objects, hive_metastore_client,
self,
mocked_get_partition_keys_objects,
hive_metastore_client,
):
# arrange
table_name = "table_name"
Expand Down Expand Up @@ -654,7 +668,9 @@ def test_get_partition_values_from_table_with_non_partitioned_table(

mocked_get_partition_keys_objects.return_value = []
expected_partition_values_request = PartitionValuesRequest(
dbName=database_name, tblName=table_name, partitionKeys=[],
dbName=database_name,
tblName=table_name,
partitionKeys=[],
)

mocked_get_partition_values.side_effect = [TTransportException()]
Expand Down