This is an automated email from the ASF dual-hosted git repository.

curth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-dotnet.git


The following commit(s) were added to refs/heads/main by this push:
     new 7ff7375  Feedback from previous PR (#110)
7ff7375 is described below

commit 7ff7375c3f22d8746b150001f1914b09f3d7f5ec
Author: Curt Hagenlocher <[email protected]>
AuthorDate: Mon Oct 6 08:12:05 2025 -0700

    Feedback from previous PR (#110)
    
    Apply feedback from PR for #100:
    
    - Mark method as obsolete now instead of waiting
    - Fix comment
---
 src/Apache.Arrow.Flight/Internal/SchemaWriter.cs                     | 5 +++--
 src/Apache.Arrow/ArrowSerializationHelpers.cs                        | 2 +-
 .../Apache.Arrow.Flight.Sql.Tests/FlightSqlPreparedStatementTests.cs | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/Apache.Arrow.Flight/Internal/SchemaWriter.cs 
b/src/Apache.Arrow.Flight/Internal/SchemaWriter.cs
index 8ca4cee..b4315a3 100644
--- a/src/Apache.Arrow.Flight/Internal/SchemaWriter.cs
+++ b/src/Apache.Arrow.Flight/Internal/SchemaWriter.cs
@@ -13,6 +13,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+using System;
 using Apache.Arrow.Flight;
 using Google.Protobuf;
 
@@ -20,7 +21,7 @@ namespace Apache.Arrow.Flight
 {
     internal static class SchemaWriter
     {
-        public static ByteString ToByteString(Schema schema)
+        public static ByteString ToByteString(this Schema schema)
         {
             return schema == null ?
                 ByteString.Empty :
@@ -32,7 +33,7 @@ namespace Apache.Arrow.Flight
 public static class SchemaExtension
 {
     // This should never have been a public class without a namespace
-    // TODO: Mark as obsolete once sufficient time has passed
+    [Obsolete("Use ArrowSerializationHelpers.SerializeSchema instead")]
     public static ByteString ToByteString(this Apache.Arrow.Schema schema)
     {
         return SchemaWriter.ToByteString(schema);
diff --git a/src/Apache.Arrow/ArrowSerializationHelpers.cs 
b/src/Apache.Arrow/ArrowSerializationHelpers.cs
index 88cab52..4d6d81b 100644
--- a/src/Apache.Arrow/ArrowSerializationHelpers.cs
+++ b/src/Apache.Arrow/ArrowSerializationHelpers.cs
@@ -58,7 +58,7 @@ namespace Apache.Arrow
         }
 
         /// <summary>
-        /// This class handles writing schemas
+        /// Helper useful when writing just individual parts of the Arrow IPC 
format.
         /// </summary>
         internal class SchemaWriter : ArrowStreamWriter
         {
diff --git 
a/test/Apache.Arrow.Flight.Sql.Tests/FlightSqlPreparedStatementTests.cs 
b/test/Apache.Arrow.Flight.Sql.Tests/FlightSqlPreparedStatementTests.cs
index 3e40293..2fc4a2e 100644
--- a/test/Apache.Arrow.Flight.Sql.Tests/FlightSqlPreparedStatementTests.cs
+++ b/test/Apache.Arrow.Flight.Sql.Tests/FlightSqlPreparedStatementTests.cs
@@ -164,8 +164,8 @@ namespace Apache.Arrow.Flight.Sql.Tests
             var actionResult = new ActionCreatePreparedStatementResult
             {
                 PreparedStatementHandle = 
ByteString.CopyFrom(preparedStatementHandle, Encoding.UTF8),
-                DatasetSchema = _schema.ToByteString(),
-                ParameterSchema = _schema.ToByteString()
+                DatasetSchema = 
UnsafeByteOperations.UnsafeWrap(ArrowSerializationHelpers.SerializeSchema(_schema)),
+                ParameterSchema = 
UnsafeByteOperations.UnsafeWrap(ArrowSerializationHelpers.SerializeSchema(_schema)),
             };
             var flightData = new FlightData(_flightDescriptor, 
ByteString.CopyFrom(actionResult.ToByteArray()));
             var results = GetAsyncEnumerable(new List<FlightData> { flightData 
});

Reply via email to