From 2a7761b321d0fa4b3e078151f79e07c099fd433a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Fri, 20 Mar 2026 09:56:32 +0100 Subject: [PATCH] GH-49565: [Python] Copy CKmsConnectionConfig instead of trying to move the const received one --- python/pyarrow/_parquet_encryption.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/pyarrow/_parquet_encryption.pyx b/python/pyarrow/_parquet_encryption.pyx index 6185d5f2392c..db6a6b56ac4c 100644 --- a/python/pyarrow/_parquet_encryption.pyx +++ b/python/pyarrow/_parquet_encryption.pyx @@ -297,7 +297,10 @@ cdef class KmsConnectionConfig(_Weakrefable): @staticmethod cdef wrap(const CKmsConnectionConfig& config): result = KmsConnectionConfig() - result.configuration = make_shared[CKmsConnectionConfig](move(config)) + # We require a copy of the config because the input is + # a const reference owned by C++. + cdef CKmsConnectionConfig config_copy = config + result.configuration = make_shared[CKmsConnectionConfig](move(config_copy)) return result