Skip to content

Commit

Permalink
Merge pull request #172 from julep-ai/release-please--branches--main-…
Browse files Browse the repository at this point in the history
…-changes--next

release: 1.42.1
  • Loading branch information
creatorrr authored Nov 27, 2024
2 parents f455732 + 8cc6aa5 commit cd5b47b
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.42.0"
".": "1.42.1"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 1.42.1 (2024-11-26)

Full Changelog: [v1.42.0...v1.42.1](https://github.com/julep-ai/python-sdk/compare/v1.42.0...v1.42.1)

### Chores

* **internal:** codegen related update ([#175](https://github.com/julep-ai/python-sdk/issues/175)) ([d058571](https://github.com/julep-ai/python-sdk/commit/d058571beb49ea1ea9101ea5b6622fa2b6ea679c))
* **internal:** fix compat model_dump method when warnings are passed ([#171](https://github.com/julep-ai/python-sdk/issues/171)) ([45fdda6](https://github.com/julep-ai/python-sdk/commit/45fdda6fdca71cbaefc86332dcc73e1a2a173f1a))


### Documentation

* add info log level to readme ([#173](https://github.com/julep-ai/python-sdk/issues/173)) ([7eb93ee](https://github.com/julep-ai/python-sdk/commit/7eb93eefb33c11f8186962cf20fc2caec3de49d6))

## 1.42.0 (2024-11-22)

Full Changelog: [v1.41.0...v1.42.0](https://github.com/julep-ai/python-sdk/compare/v1.41.0...v1.42.0)
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,14 @@ Note that requests that time out are [retried twice by default](#retries).

We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.

You can enable logging by setting the environment variable `JULEP_LOG` to `debug`.
You can enable logging by setting the environment variable `JULEP_LOG` to `info`.

```shell
$ export JULEP_LOG=debug
$ export JULEP_LOG=info
```

Or to `debug` for more verbose logging.

### How to tell whether `None` means `null` or missing

In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "julep"
version = "1.42.0"
version = "1.42.1"
description = "The official Python library for the julep API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand All @@ -16,7 +16,6 @@ dependencies = [
"sniffio",
"ruamel.yaml>=0.18.6, <0.19",
"python-dotenv>=1.0, <1.1",
"cached-property; python_version < '3.8'",
]
requires-python = ">= 3.8"
classifiers = [
Expand Down
8 changes: 3 additions & 5 deletions src/julep/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ def model_dump(
exclude=exclude,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
warnings=warnings,
# warnings are not supported in Pydantic v1
warnings=warnings if PYDANTIC_V2 else True,
)
return cast(
"dict[str, Any]",
Expand Down Expand Up @@ -213,9 +214,6 @@ def __set_name__(self, owner: type[Any], name: str) -> None: ...
# __set__ is not defined at runtime, but @cached_property is designed to be settable
def __set__(self, instance: object, value: _T) -> None: ...
else:
try:
from functools import cached_property as cached_property
except ImportError:
from cached_property import cached_property as cached_property
from functools import cached_property as cached_property

typed_cached_property = cached_property
2 changes: 1 addition & 1 deletion src/julep/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "julep"
__version__ = "1.42.0" # x-release-please-version
__version__ = "1.42.1" # x-release-please-version
8 changes: 8 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,14 @@ class Model(BaseModel):
m.model_dump(warnings=False)


def test_compat_method_no_error_for_warnings() -> None:
class Model(BaseModel):
foo: Optional[str]

m = Model(foo="hello")
assert isinstance(model_dump(m, warnings=False), dict)


def test_to_json() -> None:
class Model(BaseModel):
foo: Optional[str] = Field(alias="FOO", default=None)
Expand Down

0 comments on commit cd5b47b

Please sign in to comment.