diff --git a/src/Dax.Metadata/ExtractorSettings.cs b/src/Dax.Metadata/ExtractorProperties.cs similarity index 82% rename from src/Dax.Metadata/ExtractorSettings.cs rename to src/Dax.Metadata/ExtractorProperties.cs index 6560b11..8ebe546 100644 --- a/src/Dax.Metadata/ExtractorSettings.cs +++ b/src/Dax.Metadata/ExtractorProperties.cs @@ -1,21 +1,14 @@ namespace Dax.Metadata; -using Newtonsoft.Json; using System.ComponentModel; -public sealed class ExtractorSettings +public sealed class ExtractorProperties { /// /// Specifies whether to enable statistics collection from the data instead of relying on the the DMVs. The result is more accurate statistics, but it can be slower. /// public bool StatisticsEnabled { get; set; } - /// - /// This settings only applies when is . - /// - [JsonIgnore] // Ignored in JSON serialization because RI violation values are not serialized - public int ReferentialIntegrityViolationSamples { get; set; } - /// /// This settings only applies when is . /// diff --git a/src/Dax.Metadata/Model.cs b/src/Dax.Metadata/Model.cs index b05836c..812b048 100644 --- a/src/Dax.Metadata/Model.cs +++ b/src/Dax.Metadata/Model.cs @@ -28,7 +28,7 @@ public class Model /// /// Specifies settings used by the extractor /// - public ExtractorSettings ExtractorSettings { get; set; } + public ExtractorProperties ExtractorProperties { get; set; } /// /// Library that manages the model info (e.g. Dax.Model) /// @@ -100,7 +100,7 @@ public class Model public Model() { - ExtractorSettings = new(); + ExtractorProperties = new(); this.Tables = new List(); this.Relationships = new List(); this.Roles = new List(); diff --git a/src/Dax.Model.Extractor/StatExtractor.cs b/src/Dax.Model.Extractor/StatExtractor.cs index 776d0ae..96d89b5 100644 --- a/src/Dax.Model.Extractor/StatExtractor.cs +++ b/src/Dax.Model.Extractor/StatExtractor.cs @@ -26,11 +26,11 @@ protected IDbCommand CreateCommand(string commandText) [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. - daxModel.ExtractorSettings.StatisticsEnabled = true; - daxModel.ExtractorSettings.DirectQueryMode = analyzeDirectQuery ? DirectQueryExtractionMode.Full : DirectQueryExtractionMode.None; - daxModel.ExtractorSettings.DirectLakeMode = analyzeDirectLake; - daxModel.ExtractorSettings.ReferentialIntegrityViolationSamples = sampleRows; + // TODO: Remove after rafactoring the code to use ExtractorSettings: ExtractorProperties as a parameter + daxModel.ExtractorProperties.StatisticsEnabled = true; + daxModel.ExtractorProperties.DirectQueryMode = analyzeDirectQuery ? DirectQueryExtractionMode.Full : DirectQueryExtractionMode.None; + daxModel.ExtractorProperties.DirectLakeMode = analyzeDirectLake; + //daxModel.ExtractorProperties.ReferentialIntegrityViolationSamples = sampleRows; StatExtractor extractor = new StatExtractor(daxModel, connection); extractor.LoadTableStatistics(analyzeDirectQuery, analyzeDirectLake);