diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b4e0d6..9d50d9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: lint: name: lint runs-on: ubuntu-latest - if: github.repository == 'Dataherald/dataherald-python' + steps: - uses: actions/checkout@v3 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6db19b9..463488b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.17.0" + ".": "0.17.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 226ef59..d3c1a8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,21 @@ # Changelog -## 0.17.0 (2024-02-09) +## 0.17.1 (2024-02-19) -Full Changelog: [v0.16.0...v0.17.0](https://github.com/Dataherald/dataherald-python/compare/v0.16.0...v0.17.0) +Full Changelog: [v0.16.0...v0.17.1](https://github.com/Dataherald/dataherald-python/compare/v0.16.0...v0.17.1) ### Features -* OpenAPI spec update ([#38](https://github.com/Dataherald/dataherald-python/issues/38)) ([5852d74](https://github.com/Dataherald/dataherald-python/commit/5852d745b443ac13bf771c1bd4c507f66a91620c)) +* Add initial Stainless SDK ([6609250](https://github.com/Dataherald/dataherald-python/commit/6609250456ab0823a593a5ba0d02273480ee2b3c)) +* Add initial Stainless SDK ([5bb16c7](https://github.com/Dataherald/dataherald-python/commit/5bb16c71c17bc7b284112e3b154d1d02baeb4694)) +* Add initial Stainless SDK ([4ef184a](https://github.com/Dataherald/dataherald-python/commit/4ef184a773477c504daa960910d01045d92b0640)) +* update via SDK Studio ([#42](https://github.com/Dataherald/dataherald-python/issues/42)) ([5fb018b](https://github.com/Dataherald/dataherald-python/commit/5fb018b58c6e283496bc2ff8b3a178cbe09c41f4)) +* update via SDK Studio ([#44](https://github.com/Dataherald/dataherald-python/issues/44)) ([0e38464](https://github.com/Dataherald/dataherald-python/commit/0e38464bc3291186574a1b7bbde84e653a9f5cf0)) + + +### Chores + +* go live ([#40](https://github.com/Dataherald/dataherald-python/issues/40)) ([1bcb040](https://github.com/Dataherald/dataherald-python/commit/1bcb04011466fb4e338c416d23bfed1ebb2ab2e6)) ## 0.16.0 (2024-01-24) diff --git a/bin/check-release-environment b/bin/check-release-environment index 620cb0f..5c4d2d2 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -6,9 +6,9 @@ if [ -z "${PYPI_TOKEN}" ]; then errors+=("The DATAHERALD_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi -len=${#errors[@]} +lenErrors=${#errors[@]} -if [[ len -gt 0 ]]; then +if [[ lenErrors -gt 0 ]]; then echo -e "Found the following errors in the release environment:\n" for error in "${errors[@]}"; do diff --git a/pyproject.toml b/pyproject.toml index b029e57..f11ca66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "dataherald" -version = "0.17.0" +version = "0.17.1" description = "The official Python library for the Dataherald API" readme = "README.md" license = "Apache-2.0" diff --git a/src/dataherald/_version.py b/src/dataherald/_version.py index 4225dea..d5df6cd 100644 --- a/src/dataherald/_version.py +++ b/src/dataherald/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. __title__ = "dataherald" -__version__ = "0.17.0" # x-release-please-version +__version__ = "0.17.1" # x-release-please-version diff --git a/src/dataherald/resources/finetunings.py b/src/dataherald/resources/finetunings.py index c561f3c..f5f8161 100644 --- a/src/dataherald/resources/finetunings.py +++ b/src/dataherald/resources/finetunings.py @@ -41,9 +41,9 @@ def with_streaming_response(self) -> FinetuningsWithStreamingResponse: def create( self, *, + alias: str, + base_llm: finetuning_create_params.BaseLlm, db_connection_id: str, - alias: str | NotGiven = NOT_GIVEN, - base_llm: finetuning_create_params.BaseLlm | NotGiven = NOT_GIVEN, golden_sqls: List[str] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -69,9 +69,9 @@ def create( "/api/finetunings", body=maybe_transform( { - "db_connection_id": db_connection_id, "alias": alias, "base_llm": base_llm, + "db_connection_id": db_connection_id, "golden_sqls": golden_sqls, "metadata": metadata, }, @@ -199,9 +199,9 @@ def with_streaming_response(self) -> AsyncFinetuningsWithStreamingResponse: async def create( self, *, + alias: str, + base_llm: finetuning_create_params.BaseLlm, db_connection_id: str, - alias: str | NotGiven = NOT_GIVEN, - base_llm: finetuning_create_params.BaseLlm | NotGiven = NOT_GIVEN, golden_sqls: List[str] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -227,9 +227,9 @@ async def create( "/api/finetunings", body=maybe_transform( { - "db_connection_id": db_connection_id, "alias": alias, "base_llm": base_llm, + "db_connection_id": db_connection_id, "golden_sqls": golden_sqls, "metadata": metadata, }, diff --git a/src/dataherald/resources/golden_sqls.py b/src/dataherald/resources/golden_sqls.py index fb3b76c..d5639f5 100644 --- a/src/dataherald/resources/golden_sqls.py +++ b/src/dataherald/resources/golden_sqls.py @@ -76,6 +76,7 @@ def list( self, *, ascend: bool | NotGiven = NOT_GIVEN, + db_connection_id: str | NotGiven = NOT_GIVEN, order: str | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, @@ -108,6 +109,7 @@ def list( query=maybe_transform( { "ascend": ascend, + "db_connection_id": db_connection_id, "order": order, "page": page, "page_size": page_size, @@ -230,6 +232,7 @@ async def list( self, *, ascend: bool | NotGiven = NOT_GIVEN, + db_connection_id: str | NotGiven = NOT_GIVEN, order: str | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, @@ -262,6 +265,7 @@ async def list( query=maybe_transform( { "ascend": ascend, + "db_connection_id": db_connection_id, "order": order, "page": page, "page_size": page_size, diff --git a/src/dataherald/types/db_connection_response.py b/src/dataherald/types/db_connection_response.py index da1589b..4b8f1e4 100644 --- a/src/dataherald/types/db_connection_response.py +++ b/src/dataherald/types/db_connection_response.py @@ -5,15 +5,15 @@ from .._models import BaseModel -__all__ = ["DBConnectionResponse", "Metadata", "MetadataDataheraldInternal", "SSHSettings"] +__all__ = ["DBConnectionResponse", "Metadata", "MetadataDhInternal", "SSHSettings"] -class MetadataDataheraldInternal(BaseModel): +class MetadataDhInternal(BaseModel): organization_id: Optional[str] = None class Metadata(BaseModel): - dataherald_internal: Optional[MetadataDataheraldInternal] = None + dh_internal: Optional[MetadataDhInternal] = None class SSHSettings(BaseModel): diff --git a/src/dataherald/types/finetuning_create_params.py b/src/dataherald/types/finetuning_create_params.py index 1b07204..5c076a9 100644 --- a/src/dataherald/types/finetuning_create_params.py +++ b/src/dataherald/types/finetuning_create_params.py @@ -9,11 +9,11 @@ class FinetuningCreateParams(TypedDict, total=False): - db_connection_id: Required[str] + alias: Required[str] - alias: str + base_llm: Required[BaseLlm] - base_llm: BaseLlm + db_connection_id: Required[str] golden_sqls: List[str] diff --git a/src/dataherald/types/finetuning_response.py b/src/dataherald/types/finetuning_response.py index 9f432f0..dc8e18a 100644 --- a/src/dataherald/types/finetuning_response.py +++ b/src/dataherald/types/finetuning_response.py @@ -7,7 +7,7 @@ from .._models import BaseModel -__all__ = ["FinetuningResponse", "BaseLlm", "Metadata", "MetadataDataheraldInternal"] +__all__ = ["FinetuningResponse", "BaseLlm", "Metadata", "MetadataDhInternal"] class BaseLlm(BaseModel): @@ -18,33 +18,35 @@ class BaseLlm(BaseModel): api_model_provider: Optional[str] = FieldInfo(alias="model_provider", default=None) -class MetadataDataheraldInternal(BaseModel): +class MetadataDhInternal(BaseModel): organization_id: Optional[str] = None class Metadata(BaseModel): - dataherald_internal: Optional[MetadataDataheraldInternal] = None + dh_internal: Optional[MetadataDhInternal] = None class FinetuningResponse(BaseModel): id: str - api_model_id: Optional[str] = FieldInfo(alias="_model_id", default=None) + alias: str + + db_connection_id: str base_llm: Optional[BaseLlm] = None created_at: Optional[datetime] = None - db_connection_id: Optional[str] = None - error: Optional[str] = None finetuning_file_id: Optional[str] = None finetuning_job_id: Optional[str] = None - golden_records: Optional[List[str]] = None + golden_sqls: Optional[List[str]] = None metadata: Optional[Metadata] = None + api_model_id: Optional[str] = FieldInfo(alias="model_id", default=None) + status: Optional[str] = None diff --git a/src/dataherald/types/golden_sql_list_params.py b/src/dataherald/types/golden_sql_list_params.py index 0eb38b8..5c77986 100644 --- a/src/dataherald/types/golden_sql_list_params.py +++ b/src/dataherald/types/golden_sql_list_params.py @@ -10,6 +10,8 @@ class GoldenSqlListParams(TypedDict, total=False): ascend: bool + db_connection_id: str + order: str page: int diff --git a/src/dataherald/types/prompt_response.py b/src/dataherald/types/prompt_response.py index 0f3b50d..9da655b 100644 --- a/src/dataherald/types/prompt_response.py +++ b/src/dataherald/types/prompt_response.py @@ -6,10 +6,10 @@ from .._models import BaseModel -__all__ = ["PromptResponse", "Metadata", "MetadataDataheraldInternal", "MetadataDataheraldInternalSlackInfo"] +__all__ = ["PromptResponse", "Metadata", "MetadataDhInternal", "MetadataDhInternalSlackInfo"] -class MetadataDataheraldInternalSlackInfo(BaseModel): +class MetadataDhInternalSlackInfo(BaseModel): channel_id: Optional[str] = None thread_ts: Optional[str] = None @@ -19,7 +19,7 @@ class MetadataDataheraldInternalSlackInfo(BaseModel): username: Optional[str] = None -class MetadataDataheraldInternal(BaseModel): +class MetadataDhInternal(BaseModel): created_by: Optional[str] = None display_id: Optional[str] = None @@ -33,13 +33,13 @@ class MetadataDataheraldInternal(BaseModel): organization_id: Optional[str] = None - slack_info: Optional[MetadataDataheraldInternalSlackInfo] = None + slack_info: Optional[MetadataDhInternalSlackInfo] = None updated_by: Optional[str] = None class Metadata(BaseModel): - dataherald_internal: Optional[MetadataDataheraldInternal] = None + dh_internal: Optional[MetadataDhInternal] = None class PromptResponse(BaseModel): diff --git a/src/dataherald/types/shared/golden_sql_response.py b/src/dataherald/types/shared/golden_sql_response.py index b01aef7..68a0f5b 100644 --- a/src/dataherald/types/shared/golden_sql_response.py +++ b/src/dataherald/types/shared/golden_sql_response.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["GoldenSqlResponse", "Metadata", "MetadataDataheraldInternal"] +__all__ = ["GoldenSqlResponse", "Metadata", "MetadataDhInternal"] -class MetadataDataheraldInternal(BaseModel): +class MetadataDhInternal(BaseModel): display_id: Optional[str] = None organization_id: Optional[str] = None @@ -21,7 +21,7 @@ class MetadataDataheraldInternal(BaseModel): class Metadata(BaseModel): - dataherald_internal: Optional[MetadataDataheraldInternal] = None + dh_internal: Optional[MetadataDhInternal] = None class GoldenSqlResponse(BaseModel): diff --git a/src/dataherald/types/shared/instruction_response.py b/src/dataherald/types/shared/instruction_response.py index 14653c0..3d5ad27 100644 --- a/src/dataherald/types/shared/instruction_response.py +++ b/src/dataherald/types/shared/instruction_response.py @@ -9,7 +9,7 @@ class Metadata(BaseModel): - dataherald_internal: Optional[object] = None + dh_internal: Optional[object] = None class InstructionResponse(BaseModel): diff --git a/src/dataherald/types/shared/nl_generation_response.py b/src/dataherald/types/shared/nl_generation_response.py index 1dd0b25..14ee8e1 100644 --- a/src/dataherald/types/shared/nl_generation_response.py +++ b/src/dataherald/types/shared/nl_generation_response.py @@ -5,15 +5,15 @@ from ..._models import BaseModel -__all__ = ["NlGenerationResponse", "Metadata", "MetadataDataheraldInternal"] +__all__ = ["NlGenerationResponse", "Metadata", "MetadataDhInternal"] -class MetadataDataheraldInternal(BaseModel): +class MetadataDhInternal(BaseModel): organization_id: Optional[str] = None class Metadata(BaseModel): - dataherald_internal: Optional[MetadataDataheraldInternal] = None + dh_internal: Optional[MetadataDhInternal] = None class NlGenerationResponse(BaseModel): diff --git a/src/dataherald/types/shared/sql_generation_response.py b/src/dataherald/types/shared/sql_generation_response.py index e7eef84..a188d6e 100644 --- a/src/dataherald/types/shared/sql_generation_response.py +++ b/src/dataherald/types/shared/sql_generation_response.py @@ -6,15 +6,15 @@ from ..._models import BaseModel -__all__ = ["SqlGenerationResponse", "Metadata", "MetadataDataheraldInternal"] +__all__ = ["SqlGenerationResponse", "Metadata", "MetadataDhInternal"] -class MetadataDataheraldInternal(BaseModel): +class MetadataDhInternal(BaseModel): organization_id: Optional[str] = None class Metadata(BaseModel): - dataherald_internal: Optional[MetadataDataheraldInternal] = None + dh_internal: Optional[MetadataDhInternal] = None class SqlGenerationResponse(BaseModel): diff --git a/src/dataherald/types/table_description_response.py b/src/dataherald/types/table_description_response.py index 1cefe72..c65b38d 100644 --- a/src/dataherald/types/table_description_response.py +++ b/src/dataherald/types/table_description_response.py @@ -26,7 +26,7 @@ class Column(BaseModel): class Metadata(BaseModel): - dataherald_internal: Optional[object] = None + dh_internal: Optional[object] = None class TableDescriptionResponse(BaseModel): diff --git a/tests/api_resources/test_finetunings.py b/tests/api_resources/test_finetunings.py index 84e6b16..16d0090 100644 --- a/tests/api_resources/test_finetunings.py +++ b/tests/api_resources/test_finetunings.py @@ -23,6 +23,8 @@ class TestFinetunings: @parametrize def test_method_create(self, client: Dataherald) -> None: finetuning = client.finetunings.create( + alias="string", + base_llm={}, db_connection_id="string", ) assert_matches_type(FinetuningResponse, finetuning, path=["response"]) @@ -30,13 +32,13 @@ def test_method_create(self, client: Dataherald) -> None: @parametrize def test_method_create_with_all_params(self, client: Dataherald) -> None: finetuning = client.finetunings.create( - db_connection_id="string", alias="string", base_llm={ "model_provider": "string", "model_name": "string", "model_parameters": {"foo": "string"}, }, + db_connection_id="string", golden_sqls=["string", "string", "string"], metadata={}, ) @@ -45,6 +47,8 @@ def test_method_create_with_all_params(self, client: Dataherald) -> None: @parametrize def test_raw_response_create(self, client: Dataherald) -> None: response = client.finetunings.with_raw_response.create( + alias="string", + base_llm={}, db_connection_id="string", ) @@ -56,6 +60,8 @@ def test_raw_response_create(self, client: Dataherald) -> None: @parametrize def test_streaming_response_create(self, client: Dataherald) -> None: with client.finetunings.with_streaming_response.create( + alias="string", + base_llm={}, db_connection_id="string", ) as response: assert not response.is_closed @@ -180,6 +186,8 @@ class TestAsyncFinetunings: @parametrize async def test_method_create(self, async_client: AsyncDataherald) -> None: finetuning = await async_client.finetunings.create( + alias="string", + base_llm={}, db_connection_id="string", ) assert_matches_type(FinetuningResponse, finetuning, path=["response"]) @@ -187,13 +195,13 @@ async def test_method_create(self, async_client: AsyncDataherald) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncDataherald) -> None: finetuning = await async_client.finetunings.create( - db_connection_id="string", alias="string", base_llm={ "model_provider": "string", "model_name": "string", "model_parameters": {"foo": "string"}, }, + db_connection_id="string", golden_sqls=["string", "string", "string"], metadata={}, ) @@ -202,6 +210,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncDataherald @parametrize async def test_raw_response_create(self, async_client: AsyncDataherald) -> None: response = await async_client.finetunings.with_raw_response.create( + alias="string", + base_llm={}, db_connection_id="string", ) @@ -213,6 +223,8 @@ async def test_raw_response_create(self, async_client: AsyncDataherald) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncDataherald) -> None: async with async_client.finetunings.with_streaming_response.create( + alias="string", + base_llm={}, db_connection_id="string", ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_golden_sqls.py b/tests/api_resources/test_golden_sqls.py index 17f4bb1..a957984 100644 --- a/tests/api_resources/test_golden_sqls.py +++ b/tests/api_resources/test_golden_sqls.py @@ -68,6 +68,7 @@ def test_method_list(self, client: Dataherald) -> None: def test_method_list_with_all_params(self, client: Dataherald) -> None: golden_sql = client.golden_sqls.list( ascend=True, + db_connection_id="string", order="string", page=0, page_size=0, @@ -262,6 +263,7 @@ async def test_method_list(self, async_client: AsyncDataherald) -> None: async def test_method_list_with_all_params(self, async_client: AsyncDataherald) -> None: golden_sql = await async_client.golden_sqls.list( ascend=True, + db_connection_id="string", order="string", page=0, page_size=0,