Skip to content

Commit 70807bb

Browse files
rokpaddyroddy
andcommitted
GH-7: [Python] Fix invalid-context-manager error (#30)
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix invalid-context-manager --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
1 parent 2a6baee commit 70807bb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

python/pyarrow/tests/test_flight.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@
4949
ClientMiddleware, ClientMiddlewareFactory,
5050
)
5151
except ImportError:
52+
class context_like(object):
53+
def __enter__(self):
54+
return self
55+
def __exit__(self, exc_type, exc_value, traceback):
56+
pass
57+
5258
flight = None
53-
FlightClient, FlightServerBase = object, object
59+
FlightClient, FlightServerBase = context_like, context_like
5460
ServerAuthHandler, ClientAuthHandler = object, object
5561
ServerMiddleware, ServerMiddlewareFactory = object, object
5662
ClientMiddleware, ClientMiddlewareFactory = object, object

0 commit comments

Comments
 (0)