NavigaraNavigara
OrganizationsDistributionCompareResearch
NavigaraNavigara
OrganizationsDistributionCompareResearch
All developers

Andrew Hilger

Developer

Andrew Hilger

ahilger@meta.com

309 commits~15 files/commit

Performance

YoY:+205%
2026Previous year

Insights

Key patterns and highlights from this developer's activity.

Peak MonthAug'25340 performance
Growth Trend↓14%vs prior period
Avg Files/Commit15files per commit
Active Days146of 455 days
Top Repofbthrift309 commits

Effort Over Time

Breakdown of growth, maintenance, and fixes effort over time.

Bug Behavior

Beta

Bugs introduced vs. fixed over time.

Investment Quality

Beta

Reclassifies engineering effort based on bug attribution. Commits that introduced bugs are retrospectively counted as poor investments.

45%Productive TimeGrowth 64% + Fixes 36%
47%Maintenance Time
8%Wasted Time
How it works

Methodology

Investment Quality reclassifies engineering effort based on bug attribution data. Commits identified as buggy origins (those that introduced bugs later fixed by someone) have their grow and maintenance time moved into the Wasted Time category. Their waste (fix commits) remains counted as productive. All other commits retain their standard classification: grow is productive, maintenance is maintenance, and waste (fixes) is productive.

Relationship to Growth / Maintenance / Fixes

The standard model classifies commits as Growth, Maintenance, or Fixes. Investment Quality adds a quality lens: a commit that introduced a bug is retrospectively counted as a poor investment — the engineering time spent on it was wasted because it ultimately required additional fix work. Fix commits (Fixes in the standard model) are reframed as productive, because fixing bugs is valuable work.

Proposed API Endpoint

Currently computed client-side from commit and bug attribution data. Ideal server-side endpoint:

POST /v1/organizations/{orgId}/investment-quality
Content-Type: application/json

Request:
{
  "startTime": "2025-01-01T00:00:00Z",
  "endTime": "2025-12-31T23:59:59Z",
  "bucketSize": "BUCKET_SIZE_MONTH",
  "groupBy": ["repository_id" | "deliverer_email"]
}

Response:
{
  "productivePct": 74,
  "maintenancePct": 18,
  "wastedPct": 8,
  "buckets": [
    {
      "bucketStart": "2025-01-01T00:00:00Z",
      "productive": 4.2,
      "maintenance": 1.8,
      "wasted": 0.6
    }
  ]
}

Recent Activity

Latest analyzed commits from this developer.

HashMessageDateFilesEffort
49e440aThis commit **fixes a flaky test**, `test_queue_timeout`, in the **Thrift Python client/server test suite** by addressing an issue where `time.sleep(1)` blocked the event loop, preventing concurrent requests from queuing. The **test fix** now uses `await asyncio.sleep(1)` to yield the event loop while keeping CPU workers blocked, and dynamically sends `num_workers + 5` requests to guarantee queue saturation. This **maintenance** ensures the **queue timeout functionality** is reliably tested and validated, removing the need for the previous skip decorator.Mar 311maint
d3f8743This commit **fixes a flaky concurrency test** in the **Python Thrift server testing suite** by addressing intermittent "Load Shedding Due to Queue Timeout" errors. It resolves the issue in `test_bidi_service_str_request_concurrently` by **increasing the server's queue timeout** from 100ms to 1.0s during the test execution. This was achieved by modifying `thrift/lib/python/test/test_server.py` to add an optional `queue_timeout` parameter to the `TestServer` constructor, which then configures the underlying `ThriftServer`. The `thrift/lib/python/test/bidi_stress.py` test now passes `queue_timeout=1.0` to the `TestServer`, allowing it sufficient time to process 10,000 concurrent bidirectional stream operations. This **maintenance fix** significantly improves the reliability of the **Thrift Python test infrastructure**.Mar 312maint
9dc54a4This commit **adds new test cases** to reproduce a **critical hang bug** affecting the **asynchronous stream cancellation** mechanism in the Python Thrift library. Specifically, these tests demonstrate that **sink cancellation does not propagate promptly** when a server handler returns early while the client's async generator is blocked, leading to indefinite hangs. The new `test_bidi_sink_cancel_propagates_during_blocked_anext` in `test/bidi.py` and `test_sink_cancel_propagates_during_blocked_anext` in `test/sink.py` are currently marked `expectedFailure`, highlighting the issue in both **bidirectional streams** and **plain sink** paths. This **bug reproduction** work is crucial for addressing the robustness and resource management of **asynchronous Thrift services** that utilize these streaming patterns, alongside a minor **build dependency fix** for the bidi test.Mar 272maint
616fb30This commit **refactors** the **Thrift Python library's testing infrastructure** by moving a **bidirectional streaming stress test** into its own dedicated file, `thrift/lib/python/test/bidi_stress.py`, and a separate build target. This **maintenance** change, which includes the `echo` and `_assert_stream` methods, significantly improves the **developer experience** and **test organization** for local execution of bidi tests. The stress test was originally designed to trigger a memory lifetime bug, and its isolation now provides a **quality of life improvement** for developers.Mar 272maint
5b49416This commit **enhances the robustness of stream cancellation** within the **Thrift Python library**, specifically addressing **server-side async generator cleanup**. It ensures that resources are properly released and `finally` blocks are executed even when a client disconnects mid-stream and an error occurs within the generator's `finally` block. This **bug fix** prevents potential resource leaks or hangs in complex streaming scenarios by adding new test cases, `test_stream_cancel_cleanup_despite_finally_error` and `test_stream_cancel_cleanup_despite_async_finally_error`, to `thrift/lib/python/test/stream.py` to verify this critical error handling behavior.Mar 251maint
588d20dThis commit **reduces log verbosity** within the **Thrift Python streaming library** by suppressing unnecessary traceback prints. It modifies the `runGenerator` function in `thrift/lib/python/streaming/py_promise.pyx` to prevent printing a traceback to stderr when a server-side coroutine is cancelled. This **maintenance improvement** addresses a common scenario where client disconnections are expected, preventing excessive and noisy logging that can obscure more critical issues. The change improves **server observability** by ensuring logs are cleaner and more focused, while still preserving tracebacks for client-side cancellations.Mar 251maint
44d9669This commit **fixes a critical cancellation propagation bug** within the **Python Thrift compiler's generated service code** for **bidirectional (bidi) streams**. It replaces the custom `_handle_stream` async generator with `CloseableGenerator` in the `services.mustache` template, specifically for bidi stream wrappers. This ensures that when `aclose()` is invoked on a bidi stream wrapper while `__anext__()` is blocked, the cancellation signal is correctly propagated to the underlying handler's generator. The change significantly improves the **robustness and reliability of stream termination** in generated Python Thrift services.Mar 244waste
f9e7d2eThis commit introduces a **new capability** to the **Thrift Python streaming library** by adding `CloseableGenerator`, a class-based async iterator wrapper. This wrapper resolves a critical issue where Python's native async generators would raise a `RuntimeError` if `aclose()` was called during an in-flight `__anext__()`, preventing proper cancellation in **server-side streaming**. `CloseableGenerator` enables robust cancellation by wrapping `__anext__()` calls in an `asyncio.Task`, allowing `aclose()` to safely propagate cancellation to the underlying generator. It also incorporates `UserExceptionMeta` for describing stream exceptions and **refactors** existing stream wrapper functionality, significantly improving the reliability and error handling of **async stream processing**.Mar 243grow
ea76ed8This commit introduces `CloseableGenerator` as the new wrapper for **server-side streams** within **Thrift-Python generated services**, replacing the previous async generator implementation. This change **fixes a critical bug** where **stream cancellation failed to propagate** when `__anext__()` was in-flight, as `RuntimeError` was being swallowed. By wrapping each `__anext__()` call in an `asyncio.Task`, `CloseableGenerator` enables **external cancellation**, ensuring that **asynchronous Thrift services** can properly terminate streams. This significantly improves the reliability and resource management of **streaming RPCs**, as evidenced by the removal of `unittest.expectedFailure` from `test_stream_cancel_propagates_during_blocked_anext`.Mar 2454waste
57bc699This commit introduces a **new test case** in `thrift/lib/python/test/bidi.py` to demonstrate a **critical bug** in **bidirectional stream cancellation**. The test specifically highlights that when a client disconnects while the server-side bidi stream handler's `__anext__()` is blocked, cancellation does not propagate to the handler's generator. Marked as `unittest.expectedFailure`, this test documents an existing issue within the **Thrift Python library's bidirectional streaming functionality**, where the current async generator pattern prevents `aclose()` from effectively cancelling a blocked `__anext__()`. This addition helps track the bug and is analogous to an existing stream cancellation test.Mar 241maint
c71ad31This commit **refactors** the **Thrift Python stream cancellation regression test** located in `thrift/lib/python/test/stream.py`. The change replaces `threading.Event` and `run_in_executor` with native `asyncio` equivalents such as `asyncio.Event` and `asyncio.wait_for`, making the test fully asynchronous and removing unnecessary overhead. This **cleanup** improves the test's efficiency, readability, and adherence to `asyncio` best practices. Additionally, the docstring for the test was trimmed to focus on essential contract descriptions.Mar 231maint
022ff4dThis commit **adds a new test case** to `thrift/lib/python/test/stream.py` that **demonstrates a critical bug** in the **Thrift Python library's async-generator stream wrapper**. The test specifically exposes a scenario where server-side `aclose()` fails to propagate cancellation when `__anext__()` is blocked, preventing proper resource cleanup after a client disconnects. This **test addition** simulates a client disconnecting while the server's async generator is blocked, asserting that the generator is correctly cancelled. Currently marked as `unittest.expectedFailure`, this **test addition** serves as a clear reproduction for an upcoming fix to ensure robust **stream cancellation propagation** within the Python Thrift server.Mar 211maint
1f044d2This commit introduces a **robustness improvement** to the **Thrift Python service generation** by preventing server crashes. It **fixes a bug** in the `_handle_sink` method within the generated Python services, which previously caused an assertion failure and server termination when an empty or garbled `IOBuf` sink element was received, typically due to client cancellation or termination. The updated `thrift/compiler/generate/templates/python/services/services.mustache` template now ensures that such empty sink elements are gracefully handled as a normal sink closure, significantly **improving the stability of Thrift Python servers** under adverse network conditions.Mar 205waste
a9215cfThis commit **removes the obsolete `thrift.lib.py3_to_python.serializer` module**, which was an intermediate solution for dispatching serialization calls between `thrift.py3` and `thrift.python` types. Since `thrift.py3.serializer` is now forward-compatible, this **cleanup and refactoring** effort migrates all **10 customer Python files** that depended on the old module to directly use `thrift.py3.serializer` or `thrift.python.serializer`. This simplifies the **Thrift serialization infrastructure** by consolidating functionality and updating corresponding BUCK file dependencies. The change also involves replacing `Protocol as PythonPy3Protocol` aliases and `GENERIC_THRIFT_STRUCT` usage, culminating in the **deletion of the entire `thrift/lib/py3_to_python/` directory**.Mar 102–
6ea99dfThis commit **adds a new test case** to the **Thrift Python3 runtime** to validate and document an **inconsistent behavior of `isset`** during enum deserialization. It specifically targets scenarios where an unset, unqualified enum field, using a newly defined enum like `NoSaneDefault` that lacks a zero-valued member, results in `BadEnum` being produced, yet `isset` incorrectly reports `True`. This **test addition** exposes a critical nuance in the **Thrift deserialization logic**, highlighting that `isset` True does not always imply valid data and revealing **protocol-specific discrepancies** between JSON and BINARY/COMPACT. This work is crucial for understanding existing behavior and informing future decisions regarding `isset` usage or removal in customer code.Mar 92maint
9456e6bThis commit **adds new tests** to `thrift/lib/py3/test/auto_migrate/serializer.py` to verify the behavior of `isset` with **terse fields** and **unions** in Python 3 Thrift. Specifically, it asserts that `isset` correctly excludes terse fields and reference fields, and that for unions, `isset` consistently returns `False`. These **test additions** clarify the expected `isset` behavior, which indicates if a field's value differs from its non-default state in `thrift-python`. The new assertions are integrated into the `test_terse_struct_serialization` function, improving the robustness of the **Thrift Python 3 serialization** module.Dec 181maint
ff70313This commit **refines the assertions** for `isset` behavior within the **Thrift Python 3 test suite**, specifically in `thrift/lib/py3/test/auto_migrate/structs.py`. Based on new insights into `isset` semantics, particularly concerning `ref` fields (which are excluded from Py3) and the complex interaction with `optional` fields having default values, the `assert_isset` helper function has been updated. This **test improvement** provides more specific checks for different field types (ref, optional, unqualified) and deserialization states. The change **enhances the accuracy and robustness of `isset` validation** in Python 3 Thrift, preventing potential misinterpretations of field presence.Dec 171maint
fa8edbaThis commit delivers a **bug fix** for **type correctness** within the **Thrift Python library's metadata generation**. It resolves an issue where `gen_metadata` overloads were ignored due to an unknown `ServiceInterface` type, hindering static analysis. The fix involves updating the type hint for the `obj_or_cls` parameter in `thrift/lib/python/metadata.py` to correctly include `Client` and `Type[Client]`. Furthermore, it corrects the import path for `ServiceInterface` in the `thrift/lib/python/metadata.pyi` type stub, which also allows for the removal of related `pyre-fixme` comments. This ensures that type checkers can accurately validate **Thrift service interfaces and clients**, improving code reliability.Dec 172waste
6c408ecThis commit introduces a **new Thrift annotation**, `python.EnableUnsafeIssetInspection`, within the `thrift/annotation/python.thrift` file. This **preparatory feature** allows specific Thrift structs to explicitly opt-in to using the `isset` API, which is slated for default disablement in Python. The change lays the groundwork for a future **deprecation** of the `isset` API, ensuring that only annotated structs will retain access to this functionality in generated **Python code**. This provides a controlled mechanism for managing the transition away from `isset` usage, impacting **Python Thrift client behavior** for field inspection.Dec 1725grow
83c8056This commit provides a **bug fix** for a circular import issue in the **Python Thrift compiler's metadata generation**. It resolves an `ImportError` that could occur due to a dependency loop between `apache.thrift.metadata.thrift_types` and `apache.thrift.metadata.thrift_enums`. The fix involves modifying compiler templates (`thrift_enums.py.mustache`, `metadata_return_type.mustache`, `metadata_thrift_type.mustache`) to use **inline imports** and conditional type definitions. This prevents import-order dependent failures in generated Python code, specifically impacting `thrift/lib/thrift/metadata.thrift` by breaking the circular dependency.Dec 173waste
49e440aMar 31

This commit **fixes a flaky test**, `test_queue_timeout`, in the **Thrift Python client/server test suite** by addressing an issue where `time.sleep(1)` blocked the event loop, preventing concurrent requests from queuing. The **test fix** now uses `await asyncio.sleep(1)` to yield the event loop while keeping CPU workers blocked, and dynamically sends `num_workers + 5` requests to guarantee queue saturation. This **maintenance** ensures the **queue timeout functionality** is reliably tested and validated, removing the need for the previous skip decorator.

1 filesmaint
d3f8743Mar 31

This commit **fixes a flaky concurrency test** in the **Python Thrift server testing suite** by addressing intermittent "Load Shedding Due to Queue Timeout" errors. It resolves the issue in `test_bidi_service_str_request_concurrently` by **increasing the server's queue timeout** from 100ms to 1.0s during the test execution. This was achieved by modifying `thrift/lib/python/test/test_server.py` to add an optional `queue_timeout` parameter to the `TestServer` constructor, which then configures the underlying `ThriftServer`. The `thrift/lib/python/test/bidi_stress.py` test now passes `queue_timeout=1.0` to the `TestServer`, allowing it sufficient time to process 10,000 concurrent bidirectional stream operations. This **maintenance fix** significantly improves the reliability of the **Thrift Python test infrastructure**.

2 filesmaint
9dc54a4Mar 27

This commit **adds new test cases** to reproduce a **critical hang bug** affecting the **asynchronous stream cancellation** mechanism in the Python Thrift library. Specifically, these tests demonstrate that **sink cancellation does not propagate promptly** when a server handler returns early while the client's async generator is blocked, leading to indefinite hangs. The new `test_bidi_sink_cancel_propagates_during_blocked_anext` in `test/bidi.py` and `test_sink_cancel_propagates_during_blocked_anext` in `test/sink.py` are currently marked `expectedFailure`, highlighting the issue in both **bidirectional streams** and **plain sink** paths. This **bug reproduction** work is crucial for addressing the robustness and resource management of **asynchronous Thrift services** that utilize these streaming patterns, alongside a minor **build dependency fix** for the bidi test.

2 filesmaint
616fb30Mar 27

This commit **refactors** the **Thrift Python library's testing infrastructure** by moving a **bidirectional streaming stress test** into its own dedicated file, `thrift/lib/python/test/bidi_stress.py`, and a separate build target. This **maintenance** change, which includes the `echo` and `_assert_stream` methods, significantly improves the **developer experience** and **test organization** for local execution of bidi tests. The stress test was originally designed to trigger a memory lifetime bug, and its isolation now provides a **quality of life improvement** for developers.

2 filesmaint
5b49416Mar 25

This commit **enhances the robustness of stream cancellation** within the **Thrift Python library**, specifically addressing **server-side async generator cleanup**. It ensures that resources are properly released and `finally` blocks are executed even when a client disconnects mid-stream and an error occurs within the generator's `finally` block. This **bug fix** prevents potential resource leaks or hangs in complex streaming scenarios by adding new test cases, `test_stream_cancel_cleanup_despite_finally_error` and `test_stream_cancel_cleanup_despite_async_finally_error`, to `thrift/lib/python/test/stream.py` to verify this critical error handling behavior.

1 filesmaint
588d20dMar 25

This commit **reduces log verbosity** within the **Thrift Python streaming library** by suppressing unnecessary traceback prints. It modifies the `runGenerator` function in `thrift/lib/python/streaming/py_promise.pyx` to prevent printing a traceback to stderr when a server-side coroutine is cancelled. This **maintenance improvement** addresses a common scenario where client disconnections are expected, preventing excessive and noisy logging that can obscure more critical issues. The change improves **server observability** by ensuring logs are cleaner and more focused, while still preserving tracebacks for client-side cancellations.

1 filesmaint
44d9669Mar 24

This commit **fixes a critical cancellation propagation bug** within the **Python Thrift compiler's generated service code** for **bidirectional (bidi) streams**. It replaces the custom `_handle_stream` async generator with `CloseableGenerator` in the `services.mustache` template, specifically for bidi stream wrappers. This ensures that when `aclose()` is invoked on a bidi stream wrapper while `__anext__()` is blocked, the cancellation signal is correctly propagated to the underlying handler's generator. The change significantly improves the **robustness and reliability of stream termination** in generated Python Thrift services.

4 fileswaste
f9e7d2eMar 24

This commit introduces a **new capability** to the **Thrift Python streaming library** by adding `CloseableGenerator`, a class-based async iterator wrapper. This wrapper resolves a critical issue where Python's native async generators would raise a `RuntimeError` if `aclose()` was called during an in-flight `__anext__()`, preventing proper cancellation in **server-side streaming**. `CloseableGenerator` enables robust cancellation by wrapping `__anext__()` calls in an `asyncio.Task`, allowing `aclose()` to safely propagate cancellation to the underlying generator. It also incorporates `UserExceptionMeta` for describing stream exceptions and **refactors** existing stream wrapper functionality, significantly improving the reliability and error handling of **async stream processing**.

3 filesgrow
ea76ed8Mar 24

This commit introduces `CloseableGenerator` as the new wrapper for **server-side streams** within **Thrift-Python generated services**, replacing the previous async generator implementation. This change **fixes a critical bug** where **stream cancellation failed to propagate** when `__anext__()` was in-flight, as `RuntimeError` was being swallowed. By wrapping each `__anext__()` call in an `asyncio.Task`, `CloseableGenerator` enables **external cancellation**, ensuring that **asynchronous Thrift services** can properly terminate streams. This significantly improves the reliability and resource management of **streaming RPCs**, as evidenced by the removal of `unittest.expectedFailure` from `test_stream_cancel_propagates_during_blocked_anext`.

54 fileswaste
57bc699Mar 24

This commit introduces a **new test case** in `thrift/lib/python/test/bidi.py` to demonstrate a **critical bug** in **bidirectional stream cancellation**. The test specifically highlights that when a client disconnects while the server-side bidi stream handler's `__anext__()` is blocked, cancellation does not propagate to the handler's generator. Marked as `unittest.expectedFailure`, this test documents an existing issue within the **Thrift Python library's bidirectional streaming functionality**, where the current async generator pattern prevents `aclose()` from effectively cancelling a blocked `__anext__()`. This addition helps track the bug and is analogous to an existing stream cancellation test.

1 filesmaint
c71ad31Mar 23

This commit **refactors** the **Thrift Python stream cancellation regression test** located in `thrift/lib/python/test/stream.py`. The change replaces `threading.Event` and `run_in_executor` with native `asyncio` equivalents such as `asyncio.Event` and `asyncio.wait_for`, making the test fully asynchronous and removing unnecessary overhead. This **cleanup** improves the test's efficiency, readability, and adherence to `asyncio` best practices. Additionally, the docstring for the test was trimmed to focus on essential contract descriptions.

1 filesmaint
022ff4dMar 21

This commit **adds a new test case** to `thrift/lib/python/test/stream.py` that **demonstrates a critical bug** in the **Thrift Python library's async-generator stream wrapper**. The test specifically exposes a scenario where server-side `aclose()` fails to propagate cancellation when `__anext__()` is blocked, preventing proper resource cleanup after a client disconnects. This **test addition** simulates a client disconnecting while the server's async generator is blocked, asserting that the generator is correctly cancelled. Currently marked as `unittest.expectedFailure`, this **test addition** serves as a clear reproduction for an upcoming fix to ensure robust **stream cancellation propagation** within the Python Thrift server.

1 filesmaint
1f044d2Mar 20

This commit introduces a **robustness improvement** to the **Thrift Python service generation** by preventing server crashes. It **fixes a bug** in the `_handle_sink` method within the generated Python services, which previously caused an assertion failure and server termination when an empty or garbled `IOBuf` sink element was received, typically due to client cancellation or termination. The updated `thrift/compiler/generate/templates/python/services/services.mustache` template now ensures that such empty sink elements are gracefully handled as a normal sink closure, significantly **improving the stability of Thrift Python servers** under adverse network conditions.

5 fileswaste
a9215cfMar 10

This commit **removes the obsolete `thrift.lib.py3_to_python.serializer` module**, which was an intermediate solution for dispatching serialization calls between `thrift.py3` and `thrift.python` types. Since `thrift.py3.serializer` is now forward-compatible, this **cleanup and refactoring** effort migrates all **10 customer Python files** that depended on the old module to directly use `thrift.py3.serializer` or `thrift.python.serializer`. This simplifies the **Thrift serialization infrastructure** by consolidating functionality and updating corresponding BUCK file dependencies. The change also involves replacing `Protocol as PythonPy3Protocol` aliases and `GENERIC_THRIFT_STRUCT` usage, culminating in the **deletion of the entire `thrift/lib/py3_to_python/` directory**.

2 files–
6ea99dfMar 9

This commit **adds a new test case** to the **Thrift Python3 runtime** to validate and document an **inconsistent behavior of `isset`** during enum deserialization. It specifically targets scenarios where an unset, unqualified enum field, using a newly defined enum like `NoSaneDefault` that lacks a zero-valued member, results in `BadEnum` being produced, yet `isset` incorrectly reports `True`. This **test addition** exposes a critical nuance in the **Thrift deserialization logic**, highlighting that `isset` True does not always imply valid data and revealing **protocol-specific discrepancies** between JSON and BINARY/COMPACT. This work is crucial for understanding existing behavior and informing future decisions regarding `isset` usage or removal in customer code.

2 filesmaint
9456e6bDec 18

This commit **adds new tests** to `thrift/lib/py3/test/auto_migrate/serializer.py` to verify the behavior of `isset` with **terse fields** and **unions** in Python 3 Thrift. Specifically, it asserts that `isset` correctly excludes terse fields and reference fields, and that for unions, `isset` consistently returns `False`. These **test additions** clarify the expected `isset` behavior, which indicates if a field's value differs from its non-default state in `thrift-python`. The new assertions are integrated into the `test_terse_struct_serialization` function, improving the robustness of the **Thrift Python 3 serialization** module.

1 filesmaint
ff70313Dec 17

This commit **refines the assertions** for `isset` behavior within the **Thrift Python 3 test suite**, specifically in `thrift/lib/py3/test/auto_migrate/structs.py`. Based on new insights into `isset` semantics, particularly concerning `ref` fields (which are excluded from Py3) and the complex interaction with `optional` fields having default values, the `assert_isset` helper function has been updated. This **test improvement** provides more specific checks for different field types (ref, optional, unqualified) and deserialization states. The change **enhances the accuracy and robustness of `isset` validation** in Python 3 Thrift, preventing potential misinterpretations of field presence.

1 filesmaint
fa8edbaDec 17

This commit delivers a **bug fix** for **type correctness** within the **Thrift Python library's metadata generation**. It resolves an issue where `gen_metadata` overloads were ignored due to an unknown `ServiceInterface` type, hindering static analysis. The fix involves updating the type hint for the `obj_or_cls` parameter in `thrift/lib/python/metadata.py` to correctly include `Client` and `Type[Client]`. Furthermore, it corrects the import path for `ServiceInterface` in the `thrift/lib/python/metadata.pyi` type stub, which also allows for the removal of related `pyre-fixme` comments. This ensures that type checkers can accurately validate **Thrift service interfaces and clients**, improving code reliability.

2 fileswaste
6c408ecDec 17

This commit introduces a **new Thrift annotation**, `python.EnableUnsafeIssetInspection`, within the `thrift/annotation/python.thrift` file. This **preparatory feature** allows specific Thrift structs to explicitly opt-in to using the `isset` API, which is slated for default disablement in Python. The change lays the groundwork for a future **deprecation** of the `isset` API, ensuring that only annotated structs will retain access to this functionality in generated **Python code**. This provides a controlled mechanism for managing the transition away from `isset` usage, impacting **Python Thrift client behavior** for field inspection.

25 filesgrow
83c8056Dec 17

This commit provides a **bug fix** for a circular import issue in the **Python Thrift compiler's metadata generation**. It resolves an `ImportError` that could occur due to a dependency loop between `apache.thrift.metadata.thrift_types` and `apache.thrift.metadata.thrift_enums`. The fix involves modifying compiler templates (`thrift_enums.py.mustache`, `metadata_return_type.mustache`, `metadata_thrift_type.mustache`) to use **inline imports** and conditional type definitions. This prevents import-order dependent failures in generated Python code, specifically impacting `thrift/lib/thrift/metadata.thrift` by breaking the circular dependency.

3 fileswaste

Work Patterns

Beta

Commit activity distribution by hour and day of week. Shows when this developer is most active.

Collaboration

Beta

Developers who frequently work on the same files and symbols. Higher score means stronger code collaboration.

NavigaraNavigara
OrganizationsDistributionCompareResearch