diff --git a/src/Dax.Model.Extractor/StatExtractor.cs b/src/Dax.Model.Extractor/StatExtractor.cs index 0c91f38..776d0ae 100644 --- a/src/Dax.Model.Extractor/StatExtractor.cs +++ b/src/Dax.Model.Extractor/StatExtractor.cs @@ -22,6 +22,8 @@ protected IDbCommand CreateCommand(string commandText) return Connection.CreateCommand(commandText); } + // UpdateStatisticsModel has been marked as obsolete because its usage may require rerunning the DMVs for models with DirectLake partitions. Since this logic should be handled by the library, we may consider removing it from the public APIs in a future release. + [Obsolete("This method may produce incomplete results if used on a model with DirectLake partitions and DirectLakeExtractionMode parameter set to anything other than ResidentOnly. Use TomExtractor.GetDaxModel instead.")] public static void UpdateStatisticsModel(Dax.Metadata.Model daxModel, IDbConnection connection, int sampleRows = 0, bool analyzeDirectQuery = false , DirectLakeExtractionMode analyzeDirectLake = DirectLakeExtractionMode.ResidentOnly) { // TODO: Remove this code and use the ExtractorSettings as a parameter. diff --git a/src/Dax.Model.Extractor/TomExtractor.cs b/src/Dax.Model.Extractor/TomExtractor.cs index 75dba1e..cf55f0c 100644 --- a/src/Dax.Model.Extractor/TomExtractor.cs +++ b/src/Dax.Model.Extractor/TomExtractor.cs @@ -300,7 +300,9 @@ public static Dax.Metadata.Model GetDaxModel(string connectionString, string app // Populate statistics by querying the data model if (readStatisticsFromData) { +#pragma warning disable CS0618 // Type or member is obsolete StatExtractor.UpdateStatisticsModel(daxModel, connection, sampleRows, analyzeDirectQuery, analyzeDirectLake); +#pragma warning restore CS0618 // Type or member is obsolete // If model has any DL partitions and we have forced all columns into memory then re-run the DMVs to update the data with the new values after everything has been transcoded. if (analyzeDirectLake > DirectLakeExtractionMode.ResidentOnly && daxModel.HasDirectLakePartitions()) @@ -358,7 +360,9 @@ public static Dax.Metadata.Model GetDaxModel(string serverName, string databaseN // Populate statistics by querying the data model if (readStatisticsFromData) { +#pragma warning disable CS0618 // Type or member is obsolete StatExtractor.UpdateStatisticsModel(daxModel, connection, sampleRows, analyzeDirectQuery, analyzeDirectLake); +#pragma warning restore CS0618 // Type or member is obsolete // If model has any DL partitions and we have forced all columns into memory then re-run the DMVs to update the data with the new values after everything has been transcoded. if (analyzeDirectLake > DirectLakeExtractionMode.ResidentOnly && daxModel.HasDirectLakePartitions())