danepitkin commented on code in PR #37097:
URL: https://github.com/apache/arrow/pull/37097#discussion_r1309368053


##########
python/pyarrow/includes/libarrow_fs.pxd:
##########
@@ -23,7 +23,7 @@ from pyarrow.includes.libarrow_python cimport CTimePoint
 
 cdef extern from "arrow/filesystem/api.h" namespace "arrow::fs" nogil:
 
-    ctypedef enum CFileType "arrow::fs::FileType":
+    ctypedef enum CFileType "arrow::fs::FileType":  # numpydoc ignore=PR01

Review Comment:
   Hmm, the `cpdef enum` objects are all of type `flag` in cython 3, while they 
are of type `enum` in cython 2.
   
   Cython 3:
   
   ```
   # Python objects
   ...
   <flag 'S3LogLevel'>
   3
   6
   0
   4
   1
   2
   5
   <class 'pyarrow._s3fs.S3FileSystem'>
   <attribute 'region' of 'pyarrow._s3fs.S3FileSystem' objects>
   <class 'pyarrow._fs.PyFileSystem'>
   <attribute 'handler' of 'pyarrow._fs.PyFileSystem' objects>
   <class 'pyarrow._fs.LocalFileSystem'>
   <class 'pyarrow._hdfs.HadoopFileSystem'>
   <cyfunction HadoopFileSystem.from_uri at 0x114c41b10>
   <class 'pyarrow._gcsfs.GcsFileSystem'>
   <attribute 'project_id' of 'pyarrow._gcsfs.GcsFileSystem' objects>
   <attribute 'default_bucket_location' of 'pyarrow._gcsfs.GcsFileSystem' 
objects>
   <flag 'FileType'>
   <class 'pyarrow._fs.FileSystemHandler'>
   <cyfunction FileSystemHandler.open_output_stream at 0x114c7cba0>
   ...
   ```
   
   ```
   >>> import pyarrow as pa
   >>> pa.MetadataVersion
   <flag 'MetadataVersion'>
   >>> type(pa.MetadataVersion)
   <class 'enum.EnumType'>
   >>> type(pa.MetadataVersion.V5)
   <flag 'MetadataVersion'>
   >>> pa.MetadataVersion.V5
   <MetadataVersion.V5: 4>
   
   >>> from enum import Enum
   >>> class Color(Enum):
   ...     red = 1
   ...     blue = 2
   ...
   >>> type(Color)
   <class 'enum.EnumType'>
   >>> Color
   <enum 'Color'>
   >>> Color.blue
   <Color.blue: 2>
   >>> type(Color.blue)
   <enum 'Color'>
   ```
   
   
   Cython 2:
   ```
   >>> import pyarrow as pa
   >>> pa.MetadataVersion
   <enum 'MetadataVersion'>
   >>> type(pa.MetadataVersion)
   <class 'enum.EnumType'>
   >>> pa.MetadataVersion.V5
   <MetadataVersion.V5: 4>
   >>> type(pa.MetadataVersion.V5)
   <enum 'MetadataVersion'>
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to