Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

fix: correct method name in get_events (closes AttributeError)#224

Open
Sertug17 wants to merge 1 commit into
Polymarket:mainfrom
Sertug17:fix/get-events-parse-method-name
Open

fix: correct method name in get_events (closes AttributeError)#224
Sertug17 wants to merge 1 commit into
Polymarket:mainfrom
Sertug17:fix/get-events-parse-method-name

Conversation

@Sertug17
Copy link
Copy Markdown

@Sertug17 Sertug17 commented Apr 14, 2026

Problem

get_events() calls self.parse_event() on line 115, but this method
does not exist on GammaMarketClient. The correct method name is
self.parse_pydantic_event().

This causes a runtime AttributeError whenever get_events() is called
with parse_pydantic=True.

Fix

Replace self.parse_event(market_event_obj) with
self.parse_pydantic_event(market_event_obj) on line 115.

Reproduction

gamma = GammaMarketClient()
gamma.get_events(parse_pydantic=True)  # AttributeError: 'GammaMarketClient' object has no attribute 'parse_event'

Note

Low Risk
Low risk one-line bugfix that only changes which method is invoked when parse_pydantic=True, preventing a runtime AttributeError. Behavior remains the same aside from correctly returning parsed PolymarketEvent objects instead of crashing.

Overview
Fixes GammaMarketClient.get_events(parse_pydantic=True) by calling parse_pydantic_event() instead of a non-existent parse_event() method, eliminating a runtime AttributeError and restoring pydantic parsing for /events responses.

Reviewed by Cursor Bugbot for commit 0ee83b1. Bugbot is set up for automated code reviews on this repo. Configure here.

get_events called self.parse_event() which does not exist on
GammaMarketClient. The correct method is self.parse_pydantic_event().
This caused a runtime AttributeError when parse_pydantic=True.
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to Polymarket Agents. Thank you for creating your first PR. Cheers!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant