diff --git a/src/libraries/Microsoft.PowerFx.Connectors/PowerPlatformConnectorClient.cs b/src/libraries/Microsoft.PowerFx.Connectors/PowerPlatformConnectorClient.cs
index ff086f2f58..fed7ac4f0a 100644
--- a/src/libraries/Microsoft.PowerFx.Connectors/PowerPlatformConnectorClient.cs
+++ b/src/libraries/Microsoft.PowerFx.Connectors/PowerPlatformConnectorClient.cs
@@ -43,6 +43,8 @@ public class PowerPlatformConnectorClient : HttpClient
public string EnvironmentId { get; set; }
+ public string RequestUrlPrefix { get; init; }
+
///
/// Initializes a new instance of the class.
///
@@ -69,6 +71,20 @@ public PowerPlatformConnectorClient(string endpoint, string environmentId, strin
{
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// APIM Endpoint.
+ /// Environment Id.
+ /// /// Url Prefix for CDP connectors.
+ /// Connection/connector Id.
+ /// Function returning the JWT token.
+ /// Optional HttpMessageInvoker. If not provided a default HttpClient is used.
+ public PowerPlatformConnectorClient(string endpoint, string environmentId, string requestUrlPrefix, string connectionId, Func getAuthToken, HttpMessageInvoker httpInvoker = null)
+ : this(endpoint, environmentId, requestUrlPrefix, connectionId, getAuthToken, null, httpInvoker)
+ {
+ }
+
///
/// Initializes a new instance of the class.
///
@@ -82,6 +98,20 @@ public PowerPlatformConnectorClient(string endpoint, string environmentId, strin
{
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// APIM Endpoint.
+ /// Environment Id.
+ /// Url Prefix for CDP connectors.
+ /// Connection/connector Id.
+ /// Async function returning the JWT token.
+ /// Optional HttpMessageInvoker. If not provided a default HttpClient is used.
+ public PowerPlatformConnectorClient(string endpoint, string environmentId, string requestUrlPrefix, string connectionId, Func> getAuthToken, HttpMessageInvoker httpInvoker = null)
+ : this(endpoint, environmentId, requestUrlPrefix, connectionId, getAuthToken, null, httpInvoker)
+ {
+ }
+
///
/// Initializes a new instance of the class.
///
@@ -103,13 +133,28 @@ public PowerPlatformConnectorClient(OpenApiDocument swaggerFile, string environm
/// Environment Id.
/// Connection/connector Id.
/// Function returning the JWT token.
- /// /// Product UserAgent to add to Power-Fx one (Power-Fx/version).
+ /// Product UserAgent to add to Power-Fx one (Power-Fx/version).
/// Optional HttpMessageInvoker. If not provided a default HttpClient is used.
public PowerPlatformConnectorClient(string endpoint, string environmentId, string connectionId, Func getAuthToken, string userAgent, HttpMessageInvoker httpInvoker = null)
: this(endpoint, environmentId, connectionId, async () => getAuthToken(), userAgent, httpInvoker)
{
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// APIM Endpoint.
+ /// Environment Id.
+ /// Url Prefix for CDP connectors.
+ /// Connection/connector Id.
+ /// Async function returning the JWT token.
+ /// Product UserAgent to add to Power-Fx one (Power-Fx/version).
+ /// Optional HttpMessageInvoker. If not provided a default HttpClient is used.
+ public PowerPlatformConnectorClient(string endpoint, string environmentId, string requestUrlPrefix, string connectionId, Func getAuthToken, string userAgent, HttpMessageInvoker httpInvoker = null)
+ : this(endpoint, environmentId, requestUrlPrefix, connectionId, async () => getAuthToken(), userAgent, httpInvoker)
+ {
+ }
+
///
/// Initializes a new instance of the class.
///
@@ -120,6 +165,21 @@ public PowerPlatformConnectorClient(string endpoint, string environmentId, strin
/// Product UserAgent to add to Power-Fx one (Power-Fx/version).
/// Optional HttpMessageInvoker. If not provided a default HttpClient is used.
public PowerPlatformConnectorClient(string endpoint, string environmentId, string connectionId, Func> getAuthToken, string userAgent, HttpMessageInvoker httpInvoker = null)
+ : this(endpoint, environmentId, null, connectionId, getAuthToken, userAgent, httpInvoker)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// APIM Endpoint.
+ /// Environment Id.
+ /// Url Prefix for CDP connectors.
+ /// Connection/connector Id.
+ /// Async function returning the JWT token.
+ /// Product UserAgent to add to Power-Fx one (Power-Fx/version).
+ /// Optional HttpMessageInvoker. If not provided a default HttpClient is used.
+ public PowerPlatformConnectorClient(string endpoint, string environmentId, string requestUrlPrefix, string connectionId, Func> getAuthToken, string userAgent, HttpMessageInvoker httpInvoker = null)
{
_client = httpInvoker ?? new HttpClient();
@@ -127,6 +187,7 @@ public PowerPlatformConnectorClient(string endpoint, string environmentId, strin
ConnectionId = connectionId ?? throw new ArgumentNullException(nameof(connectionId));
EnvironmentId = environmentId ?? throw new ArgumentNullException(nameof(environmentId));
UserAgent = string.IsNullOrWhiteSpace(userAgent) ? $"PowerFx/{Version}" : $"{userAgent} PowerFx/{Version}";
+ RequestUrlPrefix = requestUrlPrefix;
// Case insensitive comparison per RFC 9110 [4.2.3 http(s) Normalization and Comparison]
if (endpoint.StartsWith($"{Uri.UriSchemeHttp}://", StringComparison.OrdinalIgnoreCase))
@@ -171,7 +232,7 @@ public override async Task SendAsync(HttpRequestMessage req
public async Task Transform(HttpRequestMessage request)
{
- var url = request.RequestUri.OriginalString;
+ var url = $"{RequestUrlPrefix ?? string.Empty}{request.RequestUri.OriginalString}";
if (request.RequestUri.IsAbsoluteUri)
{
// Client has Basepath set.
diff --git a/src/libraries/Microsoft.PowerFx.Connectors/Tabular/CdpTableResolver.cs b/src/libraries/Microsoft.PowerFx.Connectors/Tabular/CdpTableResolver.cs
index f6ea4849b5..94e754a358 100644
--- a/src/libraries/Microsoft.PowerFx.Connectors/Tabular/CdpTableResolver.cs
+++ b/src/libraries/Microsoft.PowerFx.Connectors/Tabular/CdpTableResolver.cs
@@ -24,10 +24,21 @@ internal class CdpTableResolver : ICdpTableResolver
private readonly HttpClient _httpClient;
- private readonly string _uriPrefix;
+ [Obsolete]
+ private readonly string _uriPrefix = null;
private readonly bool _doubleEncoding;
+ public CdpTableResolver(CdpTable tabularTable, HttpClient httpClient, bool doubleEncoding, ConnectorLogger logger = null)
+ {
+ _tabularTable = tabularTable;
+ _httpClient = httpClient;
+ _doubleEncoding = doubleEncoding;
+
+ Logger = logger;
+ }
+
+ [Obsolete]
public CdpTableResolver(CdpTable tabularTable, HttpClient httpClient, string uriPrefix, bool doubleEncoding, ConnectorLogger logger = null)
{
_tabularTable = tabularTable;
@@ -53,7 +64,12 @@ public async Task ResolveTableAsync(string tableName, Cancellatio
}
string dataset = _doubleEncoding ? CdpServiceBase.DoubleEncode(_tabularTable.DatasetName) : _tabularTable.DatasetName;
- string uri = (_uriPrefix ?? string.Empty) + (UseV2(_uriPrefix) ? "/v2" : string.Empty) + $"/$metadata.json/datasets/{dataset}/tables/{CdpServiceBase.DoubleEncode(tableName)}?api-version=2015-09-01";
+
+#pragma warning disable CS0612 // Type or member is obsolete
+ string prefix = string.IsNullOrEmpty(_uriPrefix) ? string.Empty : (_uriPrefix ?? string.Empty) + (UseV2(_uriPrefix) ? "/v2" : string.Empty);
+#pragma warning restore CS0612 // Type or member is obsolete
+
+ string uri = $"{prefix}/$metadata.json/datasets/{dataset}/tables/{CdpServiceBase.DoubleEncode(tableName)}?api-version=2015-09-01";
string text = await CdpServiceBase.GetObject(_httpClient, $"Get table metadata", uri, null, cancellationToken, Logger).ConfigureAwait(false);
@@ -92,7 +108,10 @@ public async Task ResolveTableAsync(string tableName, Cancellatio
// sqlRelationships = GetSqlRelationships(text2);
//}
- var parts = _uriPrefix.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+#pragma warning disable CS0612 // Type or member is obsolete
+ var parts = string.IsNullOrEmpty(_uriPrefix) ? Array.Empty() : _uriPrefix.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+#pragma warning restore CS0612 // Type or member is obsolete
+
string connectorName = (parts.Length > 1) ? parts[1] : string.Empty;
ConnectorType connectorType = ConnectorFunction.GetCdpTableType(this, connectorName, _tabularTable.TableName, "Schema/Items", FormulaValue.New(text), ConnectorSettings.DefaultCdp, _tabularTable.DatasetName,
@@ -103,8 +122,7 @@ public async Task ResolveTableAsync(string tableName, Cancellatio
return connectorType;
}
- internal static bool IsSql(string uriPrefix) => uriPrefix.Contains("/sql/");
-
+ [Obsolete]
internal static bool UseV2(string uriPrefix) => uriPrefix.Contains("/sql/") ||
uriPrefix.Contains("/zendesk/");
diff --git a/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpDataSource.cs b/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpDataSource.cs
index 6d849e105a..1311b9fde1 100644
--- a/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpDataSource.cs
+++ b/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpDataSource.cs
@@ -23,6 +23,13 @@ public CdpDataSource(string dataset)
DatasetName = dataset ?? throw new ArgumentNullException(nameof(dataset));
}
+ public static async Task GetDatasetsMetadataAsync(HttpClient httpClient, CancellationToken cancellationToken, ConnectorLogger logger = null)
+ {
+ string uri = $"/$metadata.json/datasets";
+ return await GetObject(httpClient, "Get datasets metadata", uri, null, cancellationToken, logger).ConfigureAwait(false);
+ }
+
+ [Obsolete("Use GetDatasetsMetadataAsync without urlPrefix")]
public static async Task GetDatasetsMetadataAsync(HttpClient httpClient, string uriPrefix, CancellationToken cancellationToken, ConnectorLogger logger = null)
{
string uri = (uriPrefix ?? string.Empty)
@@ -32,6 +39,27 @@ public static async Task GetDatasetsMetadataAsync(HttpClient ht
return await GetObject(httpClient, "Get datasets metadata", uri, null, cancellationToken, logger).ConfigureAwait(false);
}
+ public virtual async Task> GetTablesAsync(HttpClient httpClient, CancellationToken cancellationToken, ConnectorLogger logger = null)
+ {
+ if (DatasetMetadata == null)
+ {
+ DatasetMetadata = await GetDatasetsMetadataAsync(httpClient, cancellationToken, logger).ConfigureAwait(false);
+ }
+
+ string queryName = IsSharepoint(httpClient) ? "/alltables" : "/tables";
+ string uri = $"/datasets/{(DatasetMetadata.IsDoubleEncoding ? DoubleEncode(DatasetName) : DatasetName)}" + queryName;
+
+ GetTables tables = await GetObject(httpClient, "Get tables", uri, null, cancellationToken, logger).ConfigureAwait(false);
+ return tables?.Value?.Select((RawTable rawTable) => new CdpTable(DatasetName, rawTable.Name, DatasetMetadata, tables?.Value) { DisplayName = rawTable.DisplayName });
+
+ static bool IsSharepoint(HttpClient httpClient)
+ {
+ return httpClient is PowerPlatformConnectorClient ppcc &&
+ ppcc.RequestUrlPrefix.Contains("/sharepointonline/");
+ }
+ }
+
+ [Obsolete("Use GetTablesAsync without urlPrefix")]
public virtual async Task> GetTablesAsync(HttpClient httpClient, string uriPrefix, CancellationToken cancellationToken, ConnectorLogger logger = null)
{
if (DatasetMetadata == null)
@@ -50,6 +78,36 @@ public virtual async Task> GetTablesAsync(HttpClient httpC
return tables?.Value?.Select((RawTable rawTable) => new CdpTable(DatasetName, rawTable.Name, DatasetMetadata, tables?.Value) { DisplayName = rawTable.DisplayName });
}
+ ///
+ /// Retrieves a single CdpTable.
+ ///
+ /// HttpClient.
+ /// Table name to search.
+ /// bool? value: true = logical only, false = display name only, null = logical or display name. All comparisons are case sensitive.
+ /// Cancellation token.
+ /// Logger.
+ /// CdpTable class.
+ /// When no or more than one tables are identified.
+ public virtual async Task GetTableAsync(HttpClient httpClient, string tableName, bool? logicalOrDisplay, CancellationToken cancellationToken, ConnectorLogger logger = null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ IEnumerable tables = await GetTablesAsync(httpClient, cancellationToken, logger).ConfigureAwait(false);
+ IEnumerable filtered = tables.Where(ct => IsNameMatching(ct.TableName, ct.DisplayName, tableName, logicalOrDisplay));
+
+ if (!filtered.Any())
+ {
+ throw new InvalidOperationException("Cannot find any table with the specified name");
+ }
+
+ if (filtered.Count() > 1)
+ {
+ throw new InvalidOperationException($"Too many tables correspond to the specified name - Found {filtered.Count()} tables");
+ }
+
+ return filtered.First();
+ }
+
///
/// Retrieves a single CdpTable.
///
@@ -61,11 +119,12 @@ public virtual async Task> GetTablesAsync(HttpClient httpC
/// Logger.
/// CdpTable class.
/// When no or more than one tables are identified.
+ [Obsolete("Use GetTableAsync without urlPrefix")]
public virtual async Task GetTableAsync(HttpClient httpClient, string uriPrefix, string tableName, bool? logicalOrDisplay, CancellationToken cancellationToken, ConnectorLogger logger = null)
{
cancellationToken.ThrowIfCancellationRequested();
- IEnumerable tables = await GetTablesAsync(httpClient, uriPrefix, cancellationToken, logger).ConfigureAwait(false);
+ IEnumerable tables = await GetTablesAsync(httpClient, uriPrefix, cancellationToken, logger).ConfigureAwait(false);
IEnumerable filtered = tables.Where(ct => IsNameMatching(ct.TableName, ct.DisplayName, tableName, logicalOrDisplay));
if (!filtered.Any())
diff --git a/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpServiceBase.cs b/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpServiceBase.cs
index 4b6c24c733..b29ae26dfc 100644
--- a/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpServiceBase.cs
+++ b/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpServiceBase.cs
@@ -37,7 +37,7 @@ protected internal static async Task GetObject(HttpClient httpClient, stri
protected internal static async Task GetObject(HttpClient httpClient, string message, string uri, string content, CancellationToken cancellationToken, ConnectorLogger logger = null, [CallerMemberName] string callingMethod = "")
{
cancellationToken.ThrowIfCancellationRequested();
- string log = $"{callingMethod}.{nameof(GetObject)} for {message}, Uri {uri}";
+ string log = $"{callingMethod}.{nameof(GetObject)} for {message}, Uri {(httpClient is PowerPlatformConnectorClient ppcc ? ppcc.RequestUrlPrefix : string.Empty)}{uri}";
try
{
diff --git a/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpTable.cs b/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpTable.cs
index f039efa1b5..05abd953ca 100644
--- a/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpTable.cs
+++ b/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpTable.cs
@@ -39,7 +39,8 @@ public class CdpTable : CdpService
internal IReadOnlyCollection Tables;
- private string _uriPrefix;
+ [Obsolete]
+ private string _uriPrefix = null;
private HttpClient _httpClient;
@@ -60,6 +61,32 @@ internal CdpTable(string dataset, string table, DatasetMetadata datasetMetadata,
//// TABLE METADATA SERVICE
// GET: /$metadata.json/datasets/{datasetName}/tables/{tableName}?api-version=2015-09-01
+ public virtual async Task InitAsync(HttpClient httpClient, CancellationToken cancellationToken, ConnectorLogger logger = null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ if (IsInitialized)
+ {
+ throw new InvalidOperationException("TabularService already initialized");
+ }
+
+ _httpClient = httpClient;
+
+ if (DatasetMetadata == null)
+ {
+ await InitializeDatasetMetadata(httpClient, logger, cancellationToken).ConfigureAwait(false);
+ }
+
+ CdpTableResolver tableResolver = new CdpTableResolver(this, httpClient, DatasetMetadata.IsDoubleEncoding, logger);
+ TabularTableDescriptor = await tableResolver.ResolveTableAsync(TableName, cancellationToken).ConfigureAwait(false);
+
+ _relationships = TabularTableDescriptor.Relationships;
+ OptionSets = tableResolver.OptionSets;
+
+ RecordType = (RecordType)TabularTableDescriptor.FormulaType;
+ }
+
+ [Obsolete("Use InitAsync without uriPrefix")]
public virtual async Task InitAsync(HttpClient httpClient, string uriPrefix, CancellationToken cancellationToken, ConnectorLogger logger = null)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -87,10 +114,20 @@ public virtual async Task InitAsync(HttpClient httpClient, string uriPrefix, Can
RecordType = (RecordType)TabularTableDescriptor.FormulaType;
}
- private async Task InitializeDatasetMetadata(HttpClient httpClient, string uriPrefix, ConnectorLogger logger, CancellationToken cancellationToken)
+ private async Task InitializeDatasetMetadata(HttpClient httpClient, ConnectorLogger logger, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
+ DatasetMetadata dm = await CdpDataSource.GetDatasetsMetadataAsync(httpClient, cancellationToken, logger).ConfigureAwait(false);
+
+ DatasetMetadata = dm ?? throw new InvalidOperationException("Dataset metadata is not available");
+ }
+
+ [Obsolete]
+ private async Task InitializeDatasetMetadata(HttpClient httpClient, string uriPrefix, ConnectorLogger logger, CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
DatasetMetadata dm = await CdpDataSource.GetDatasetsMetadataAsync(httpClient, uriPrefix, cancellationToken, logger).ConfigureAwait(false);
DatasetMetadata = dm ?? throw new InvalidOperationException("Dataset metadata is not available");
@@ -110,10 +147,11 @@ protected override async Task>> GetItems
string queryParams = (odataParameters != null) ? "&" + odataParameters.ToQueryString() : string.Empty;
- Uri uri = new Uri(
- (_uriPrefix ?? string.Empty) +
- (CdpTableResolver.UseV2(_uriPrefix) ? "/v2" : string.Empty) +
- $"/datasets/{(DatasetMetadata.IsDoubleEncoding ? DoubleEncode(DatasetName) : DatasetName)}/tables/{Uri.EscapeDataString(TableName)}/items?api-version=2015-09-01" + queryParams, UriKind.Relative);
+#pragma warning disable CS0612 // Type or member is obsolete
+ string prefix = string.IsNullOrEmpty(_uriPrefix) ? string.Empty : (_uriPrefix ?? string.Empty) + (CdpTableResolver.UseV2(_uriPrefix) ? "/v2" : string.Empty);
+#pragma warning restore CS0612 // Type or member is obsolete
+
+ Uri uri = new Uri($"{prefix}/datasets/{(DatasetMetadata.IsDoubleEncoding ? DoubleEncode(DatasetName) : DatasetName)}/tables/{Uri.EscapeDataString(TableName)}/items?api-version=2015-09-01" + queryParams, UriKind.Relative);
string text = await GetObject(_httpClient, $"List items ({nameof(GetItemsInternalAsync)})", uri.ToString(), null, cancellationToken, executionLogger).ConfigureAwait(false);
return !string.IsNullOrWhiteSpace(text) ? GetResult(text) : Array.Empty>();
diff --git a/src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/CompatibilityTests.cs b/src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/CompatibilityTests.cs
index 4532660223..413140e48c 100644
--- a/src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/CompatibilityTests.cs
+++ b/src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/CompatibilityTests.cs
@@ -29,7 +29,7 @@ public void CompatibilityTest()
ConnectorLogger connectorLogger = new ConsoleLogger(_output);
CdpTable tabularTable = new CdpTable("dataset", "table", new List() { });
- CdpTableResolver tableResolver = new CdpTableResolver(tabularTable, httpClient, "prefix", true, connectorLogger);
+ CdpTableResolver tableResolver = new CdpTableResolver(tabularTable, httpClient, true, connectorLogger);
string text = (string)LoggingTestServer.GetFileText(@"Responses\Compatibility GetSchema.json");
diff --git a/src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/PowerPlatformTabularTests.cs b/src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/PowerPlatformTabularTests.cs
index d88628b7bd..5faea730b1 100644
--- a/src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/PowerPlatformTabularTests.cs
+++ b/src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/PowerPlatformTabularTests.cs
@@ -16,6 +16,7 @@
using Xunit.Abstractions;
#pragma warning disable SA1116
+#pragma warning disable SA1118
namespace Microsoft.PowerFx.Connectors.Tests
{
@@ -39,10 +40,10 @@ public async Task SQL_CdpTabular_GetTables()
using var httpClient = new HttpClient(testConnector);
string connectionId = "c1a4e9f52ec94d55bb82f319b3e33a6a";
string jwt = "eyJ0eXAiOiJKV1QiL...";
- using var client = new PowerPlatformConnectorClient("firstrelease-003.azure-apihub.net", "49970107-0806-e5a7-be5e-7c60e2750f01", connectionId, () => jwt, httpClient) { SessionId = "8e67ebdc-d402-455a-b33a-304820832383" };
+ using var client = new PowerPlatformConnectorClient("firstrelease-003.azure-apihub.net", "49970107-0806-e5a7-be5e-7c60e2750f01", $"/apim/sql/{connectionId}/v2", connectionId, () => jwt, httpClient) { SessionId = "8e67ebdc-d402-455a-b33a-304820832383" };
testConnector.SetResponseFromFile(@"Responses\SQL GetDatasetsMetadata.json");
- DatasetMetadata dm = await CdpDataSource.GetDatasetsMetadataAsync(client, $"/apim/sql/{connectionId}", CancellationToken.None, logger);
+ DatasetMetadata dm = await CdpDataSource.GetDatasetsMetadataAsync(client, CancellationToken.None, logger);
Assert.NotNull(dm);
Assert.Null(dm.Blob);
@@ -80,7 +81,7 @@ public async Task SQL_CdpTabular_GetTables()
CdpDataSource cds = new CdpDataSource("pfxdev-sql.database.windows.net,connectortest");
testConnector.SetResponseFromFiles(@"Responses\SQL GetDatasetsMetadata.json", @"Responses\SQL GetTables.json");
- IEnumerable tables = await cds.GetTablesAsync(client, $"/apim/sql/{connectionId}", CancellationToken.None, logger);
+ IEnumerable tables = await cds.GetTablesAsync(client, CancellationToken.None, logger);
Assert.NotNull(tables);
Assert.Equal(4, tables.Count());
@@ -93,7 +94,7 @@ public async Task SQL_CdpTabular_GetTables()
Assert.Equal("Customers", connectorTable.DisplayName);
testConnector.SetResponseFromFiles(@"Responses\SQL Server Load Customers DB.json", @"Responses\SQL GetRelationships SampleDB.json");
- await connectorTable.InitAsync(client, $"/apim/sql/{connectionId}", CancellationToken.None, logger);
+ await connectorTable.InitAsync(client, CancellationToken.None, logger);
Assert.True(connectorTable.IsInitialized);
CdpTableValue sqlTable = connectorTable.GetTableValue();
@@ -140,6 +141,15 @@ public async Task SQL_CdpTabular_GetTables()
result = await engine.EvalAsync("Last(Customers).Phone", CancellationToken.None, runtimeConfig: rc);
StringValue phone = Assert.IsType(result);
Assert.Equal("+1-425-705-0000", phone.Value);
+
+ Assert.Equal