MCPcopy Create free account
hub / github.com/apache/arrow / DuckWriter

Class DuckWriter

python/pyarrow/tests/test_io.py:2086–2098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2084def test_output_stream_duck_typing():
2085 # Accept objects having the right file-like methods...
2086 class DuckWriter:
2087 def __init__(self):
2088 self.buf = pa.BufferOutputStream()
2089
2090 def close(self):
2091 pass
2092
2093 @property
2094 def closed(self):
2095 return False
2096
2097 def write(self, data):
2098 self.buf.write(data)
2099
2100 duck_writer = DuckWriter()
2101 stream = pa.output_stream(duck_writer)

Callers 1

Calls

no outgoing calls

Tested by 1