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

Missing generated code for some python types in the case of some recursive defintions #1588

Closed
hellovai opened this issue Mar 11, 2025 · 1 comment
Assignees

Comments

@hellovai
Copy link
Contributor

Image
type JsonValue = int | string | bool | float | JsonObject | JsonArray
type JsonObject = map<string, JsonValue>
type JsonArray = JsonValue[]

class RecursiveAliasDependency {
  value JsonValue
}

we don't generate JsonValue in partial_types.py

@antoniosarosi antoniosarosi self-assigned this Mar 12, 2025
github-merge-queue bot pushed a commit that referenced this issue Mar 12, 2025
#1588 
<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Fix partial recursive types in `generate_types.rs` and correct import
path in `memory_test.py`.
> 
>   - **Type Reference Fixes**:
> - In `generate_types.rs`, update `FieldType::RecursiveTypeAlias` to
use `types.{name}` instead of `"{name}"`.
> - Update `Optional["{name}"]` to `Optional[types.{name}]` for
`FieldType::RecursiveTypeAlias`.
>   - **Integration Test Fix**:
> - In `partial_types.py`, change `value: Optional["JsonValue"]` to
`value: Optional[types.JsonValue]` in `RecursiveAliasDependency`.
> - Fix import path in `memory_test.py` from `from baml_client import b`
to `from ..baml_client import b`.
> 
> <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 2cd3821. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants