amoeba commented on code in PR #46961: URL: https://github.com/apache/arrow/pull/46961#discussion_r2191267079
########## python/pyarrow/_dataset.pyx: ########## @@ -3151,9 +3151,19 @@ cdef class DatasetFactory(_Weakrefable): schemas.append(pyarrow_wrap_schema(s)) return schemas - def inspect(self): + def inspect(self, *, promote_options="default", fragments=None): """ - Inspect all data fragments and return a common Schema. + Inspect data fragments and return a common Schema. + + Parameters + ---------- + promote_options : str, default "default" + Control how to unify types. Accepts strings "default" and "permissive". + Default: types must match exactly, except nulls can be merged with other types. + Permissive: types are promoted when possible. + fragments : int, optional (default None) + How many fragments should be inspected to infer the unified schema. + Use None to inspect all fragments Review Comment: ```suggestion Use ``None`` to inspect all fragments. ``` Should be like this for it to show up as code in the generated docs. Plus add trailing period. ########## python/pyarrow/_dataset.pyx: ########## @@ -3151,9 +3151,19 @@ cdef class DatasetFactory(_Weakrefable): schemas.append(pyarrow_wrap_schema(s)) return schemas - def inspect(self): + def inspect(self, *, promote_options="default", fragments=None): """ - Inspect all data fragments and return a common Schema. + Inspect data fragments and return a common Schema. + + Parameters + ---------- + promote_options : str, default "default" + Control how to unify types. Accepts strings "default" and "permissive". + Default: types must match exactly, except nulls can be merged with other types. + Permissive: types are promoted when possible. + fragments : int, optional (default None) Review Comment: ```suggestion fragments : int, optional, default None ``` I think this is slightly more consistent with existing style. We try to follow numpydoc but I don't think there's a specific lint for this. https://numpydoc.readthedocs.io/en/latest/format.html#parameters is vague but I think this is closest to their intent. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org