Skip to content

Commit ff613ce

Browse files
authored
hellovai/remove default params (#1627)
- **Revert adding default params** - **generated code fixes!** <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Removed default parameter values from functions in `async_client.py`, `sync_client.py`, `async_request.py`, and `sync_request.py` to prevent unintended side effects from mutable defaults. > > - **Behavior**: > - Removed default parameter values in functions across `async_client.py`, `sync_client.py`, and `sync_request.py`. > - Functions now require explicit parameter values, preventing unintended side effects from mutable defaults. > - **Code Generation**: > - Updated `mod.rs` to set default parameter values to `None` during code generation. > - **Affected Functions**: > - Changes in `AliasedInputList`, `BuildLinkedList`, `DynamicListInputOutput`, `ExtractResume`, `FnNamedArgsSingleStringOptional`, `InOutEnumMapKey`, `InOutLiteralStringUnionMapKey`, `InOutSingleLiteralStringMapKey`, `MapAlias`, `TestFnNamedArgsSingleEnumList`, `TestFnNamedArgsSingleMapStringToClass`, `TestFnNamedArgsSingleMapStringToMap`, `TestFnNamedArgsSingleMapStringToString`, `TestFnNamedArgsSingleStringArray`, `TestFnNamedArgsSingleStringList`, `TestImageListInput` in `async_client.py` and `sync_client.py`. > - Similar changes in `async_request.py` and `sync_request.py`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 28edef1. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent b19d1ee commit ff613ce

5 files changed

Lines changed: 129 additions & 133 deletions

File tree

engine/language_client_codegen/src/python/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,7 @@ impl TryFrom<(&'_ IntermediateRepr, &'_ crate::GeneratorArgs)> for PythonClient
248248
.inputs()
249249
.iter()
250250
.map(|(name, r#type)| {
251-
(
252-
name.to_string(),
253-
r#type.to_type_ref(ir, false),
254-
default_value_for_parameter_type(r#type),
255-
)
251+
(name.to_string(), r#type.to_type_ref(ir, false), None)
256252
})
257253
.collect(),
258254
})

integ-tests/python/baml_client/async_client.py

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)