protobuf2pydantic icon indicating copy to clipboard operation
protobuf2pydantic copied to clipboard

2024.4.18 generation broken

Open adamf-sendblocks opened this issue 1 year ago • 4 comments

We tried to upgrade from version 2023.12.21 to 2024.4.18 (the interim releases gave us the problems that have subsequently been fixed in the latest version).

For some reason, the output files are missing large chunks of code. Here's an example:

enum EventType {
    EVENT_TYPE_UNSPECIFIED = 0;
    EVENT_TYPE_ONE = 1;
    EVENT_TYPE_TWO = 2;
}

message GetEventsRequest {
    uint32 limit = 1;
    string status_filter = 2;
    EventType events_filter = 3;
}

In the previous version, the output is as follows:

class GetEventsRequest(BaseModel):
    limit: int = Field(default_factory=int)
    status_filter: str = Field(default_factory=str)

    class EventType(IntEnum):
        EVENT_TYPE_UNSPECIFIED = 0
        EVENT_TYPE_ONE = 1
        EVENT_TYPE_TWO = 2

    events_filter: EventType = Field(default_factory=int)

In the latest version, the output is as follows:

class GetEventsRequest(BaseModel):
    tenant_id: str = Field(default_factory=str)
    limit: int = Field(default_factory=int)
    status_filter: str = Field(default_factory=str)

So the event type class and events filter just got dropped.

In our response method, the same thing happened and all we were left with is the following, which isn't just wrong but invalid:

class GetEventsResponse(BaseModel):

My naive suspicion is that this is related to the fix with the inner class indentation.

adamf-sendblocks avatar May 07 '24 09:05 adamf-sendblocks

OK, I will rollback

Ed-XCF avatar May 08 '24 01:05 Ed-XCF

2024.4.18 is deleted on pypi

Ed-XCF avatar May 08 '24 01:05 Ed-XCF

2024.1.8 also deleted

Ed-XCF avatar May 08 '24 01:05 Ed-XCF

2023.12.21 is the latest release now. Sorry to have affected your work

Ed-XCF avatar May 08 '24 01:05 Ed-XCF

@Ed-XCF my apologies for the delayed response, thank you so much 🙏

adamf-sendblocks avatar May 26 '24 08:05 adamf-sendblocks