From 4a45a899811b1c778b8cecabd82b5f97c46346ab Mon Sep 17 00:00:00 2001 From: Rishab Ramanathan Date: Thu, 11 Sep 2025 12:25:52 -0700 Subject: [PATCH 1/2] fix: custom args with run_batch_from_df --- src/openlayer/lib/core/base_model.py | 10 ++-------- src/openlayer/lib/integrations/bedrock_tracer.py | 4 +--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/openlayer/lib/core/base_model.py b/src/openlayer/lib/core/base_model.py index c69fabcb..9bd25a45 100644 --- a/src/openlayer/lib/core/base_model.py +++ b/src/openlayer/lib/core/base_model.py @@ -91,12 +91,10 @@ def batch(self, dataset_path: str, output_dir: str) -> None: raise ValueError(f"Unsupported dataset format: {dataset_path}") # Call the model's run_batch method, passing in the DataFrame - output_df, config = self.run_batch_from_df(df, custom_args=self.custom_args) + output_df, config = self.run_batch_from_df(df) self.write_output_to_directory(output_df, config, output_dir, fmt) - def run_batch_from_df( - self, df: pd.DataFrame, custom_args: dict = None - ) -> Tuple[pd.DataFrame, dict]: + def run_batch_from_df(self, df: pd.DataFrame) -> Tuple[pd.DataFrame, dict]: """Function that runs the model and returns the result.""" # Ensure the 'output' column exists if "output" not in df.columns: @@ -105,10 +103,6 @@ def run_batch_from_df( # Get the signature of the 'run' method run_signature = inspect.signature(self.run) - # If the model has a custom_args attribute, update it - if hasattr(self, "custom_args") and custom_args is not None: - self.custom_args.update(custom_args) - for index, row in df.iterrows(): # Filter row_dict to only include keys that are valid parameters # for the 'run' method diff --git a/src/openlayer/lib/integrations/bedrock_tracer.py b/src/openlayer/lib/integrations/bedrock_tracer.py index 336d7cda..a497474e 100644 --- a/src/openlayer/lib/integrations/bedrock_tracer.py +++ b/src/openlayer/lib/integrations/bedrock_tracer.py @@ -25,9 +25,7 @@ logger = logging.getLogger(__name__) -def trace_bedrock( - client: "boto3.client", -) -> "boto3.client": +def trace_bedrock(client: "boto3.client") -> "boto3.client": """Patch the Bedrock client to trace model invocations. The following information is collected for each model invocation: From 978ecde005af51138bc10488a7887835465b3f6c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Sep 2025 19:27:32 +0000 Subject: [PATCH 2/2] release: 0.2.0-alpha.94 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/openlayer/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b200bc7a..d871cd14 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.0-alpha.93" + ".": "0.2.0-alpha.94" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d3b9b79d..c9a1cb5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.2.0-alpha.94 (2025-09-11) + +Full Changelog: [v0.2.0-alpha.93...v0.2.0-alpha.94](https://github.com/openlayer-ai/openlayer-python/compare/v0.2.0-alpha.93...v0.2.0-alpha.94) + +### Bug Fixes + +* custom args with run_batch_from_df ([4a45a89](https://github.com/openlayer-ai/openlayer-python/commit/4a45a899811b1c778b8cecabd82b5f97c46346ab)) + ## 0.2.0-alpha.93 (2025-09-10) Full Changelog: [v0.2.0-alpha.92...v0.2.0-alpha.93](https://github.com/openlayer-ai/openlayer-python/compare/v0.2.0-alpha.92...v0.2.0-alpha.93) diff --git a/pyproject.toml b/pyproject.toml index 0020ba8f..17f1fd53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openlayer" -version = "0.2.0-alpha.93" +version = "0.2.0-alpha.94" description = "The official Python library for the openlayer API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/openlayer/_version.py b/src/openlayer/_version.py index f821148a..dd6548f4 100644 --- a/src/openlayer/_version.py +++ b/src/openlayer/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "openlayer" -__version__ = "0.2.0-alpha.93" # x-release-please-version +__version__ = "0.2.0-alpha.94" # x-release-please-version