diff --git a/csharp/src/Drivers/BigQuery/BigQueryConnection.cs b/csharp/src/Drivers/BigQuery/BigQueryConnection.cs index 711ee02cb4..35f2adf464 100644 --- a/csharp/src/Drivers/BigQuery/BigQueryConnection.cs +++ b/csharp/src/Drivers/BigQuery/BigQueryConnection.cs @@ -85,9 +85,10 @@ internal void Open() if (!this.properties.TryGetValue(BigQueryParameters.ProjectId, out projectId)) throw new ArgumentException($"The {BigQueryParameters.ProjectId} parameter is not present"); - if (this.properties.ContainsKey(BigQueryParameters.AuthenticationType)) + if (this.properties.TryGetValue(BigQueryParameters.AuthenticationType, out string? newAuthenticationType)) { - authenticationType = this.properties[BigQueryParameters.AuthenticationType]; + if (!string.IsNullOrEmpty(newAuthenticationType)) + authenticationType = newAuthenticationType; if (!authenticationType.Equals(BigQueryConstants.UserAuthenticationType, StringComparison.OrdinalIgnoreCase) && !authenticationType.Equals(BigQueryConstants.ServiceAccountAuthenticationType, StringComparison.OrdinalIgnoreCase))