From 982a1e400f8fd67cff4d8dedb118ddfea098f328 Mon Sep 17 00:00:00 2001 From: Juan Martinez Ramirez <126511805+sfc-gh-jmartinez@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:36:14 -0600 Subject: [PATCH] SNOW-973444: Change Prepare to be handled as a Noop (#894) ### Description Change Prepare method to be handled as a noop, removed throw NotImplementedException. ### Checklist - [x] Code compiles correctly - [x] Code is formatted according to [Coding Conventions](../CodingConventions.md) - [x] Created tests which fail without the change (if possible) - [x] All tests passing (`dotnet test`) - [x] Extended the README / documentation, if necessary - [x] Provide JIRA issue id (if possible) or GitHub issue id in PR name --- Snowflake.Data.Tests/UnitTests/SFDbCommandTest.cs | 4 ++-- Snowflake.Data/Client/SnowflakeDbCommand.cs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Snowflake.Data.Tests/UnitTests/SFDbCommandTest.cs b/Snowflake.Data.Tests/UnitTests/SFDbCommandTest.cs index 714d237d2..e595002ad 100644 --- a/Snowflake.Data.Tests/UnitTests/SFDbCommandTest.cs +++ b/Snowflake.Data.Tests/UnitTests/SFDbCommandTest.cs @@ -60,9 +60,9 @@ public void TestCommandExecuteAsyncThrowsExceptionWhenCommandTextIsNotSet() } [Test] - public void TestCommandPrepareThrowsNotImplemented() + public void TestCommandPrepareShouldNotThrowsException() { - Assert.Throws(() => command.Prepare()); + Assert.DoesNotThrow(() => command.Prepare()); } } } diff --git a/Snowflake.Data/Client/SnowflakeDbCommand.cs b/Snowflake.Data/Client/SnowflakeDbCommand.cs index 15d8e0870..b52d53643 100755 --- a/Snowflake.Data/Client/SnowflakeDbCommand.cs +++ b/Snowflake.Data/Client/SnowflakeDbCommand.cs @@ -239,9 +239,12 @@ public override async Task ExecuteScalarAsync(CancellationToken cancella return DBNull.Value; } + /// + /// Prepares the command for execution. + /// This method is currently not implemented and acts as a no-operation (Noop). + /// public override void Prepare() { - throw new NotImplementedException(); } public string GetQueryId()