Copilot commented on code in PR #45998:
URL: https://github.com/apache/arrow/pull/45998#discussion_r3614957671


##########
python/pyarrow/includes/libarrow_fs.pxd:
##########
@@ -288,6 +287,12 @@ cdef extern from "arrow/filesystem/api.h" namespace 
"arrow::fs" nogil:
         void ConfigureKerberosTicketCachePath(c_string path)
         void ConfigureExtraConf(c_string key, c_string value)
 
+        const c_string& host()
+        int port()
+        const c_string& user()
+        const c_string& kerb_ticket()
+        unordered_map[c_string, c_string] extra_conf()
+
     cdef cppclass CHadoopFileSystem "arrow::fs::HadoopFileSystem"(CFileSystem):
         @staticmethod
         CResult[shared_ptr[CHadoopFileSystem]] Make(

Review Comment:
   The Cython pxd declares `HadoopFileSystem.options()` as a non-`const` 
method, but in C++ it's declared `HdfsOptions options() const` (see 
`cpp/src/arrow/filesystem/hdfs.h`). This can lead to undefined references / 
wrong mangled symbol when `_hdfs.pyx` calls `self.hdfs.options()`.
   
   Update the pxd signature to include `const`.



##########
python/pyarrow/includes/libarrow_fs.pxd:
##########
@@ -288,6 +287,12 @@ cdef extern from "arrow/filesystem/api.h" namespace 
"arrow::fs" nogil:
         void ConfigureKerberosTicketCachePath(c_string path)
         void ConfigureExtraConf(c_string key, c_string value)
 
+        const c_string& host()
+        int port()
+        const c_string& user()
+        const c_string& kerb_ticket()
+        unordered_map[c_string, c_string] extra_conf()

Review Comment:
   The `HdfsOptions` getters are declared as non-`const` methods in the Cython 
pxd, but in C++ they are `...() const` (see `cpp/src/arrow/filesystem/hdfs.h`). 
This will generate bindings that reference the wrong mangled symbols (and can 
fail to link) when `_hdfs.pyx` calls these methods.
   
   Declare them as `const` methods in the pxd to match the C++ API.



-- 
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