TabularEditor / TabularEditor3

Bug reports, feature requests, discussion and documentation for Tabular Editor 3 (commercial version).
61 stars 7 forks source link

TabularEditor_SerializeOptions - IncludeRefs does not save #1285

Open ScottThompsonNH opened 4 weeks ago

ScottThompsonNH commented 4 weeks ago

Description

Updates to the TabularEditor_SerializeOptions don't seem to save.

Tabular Editor 3 Version

3.14

Screenshots

I want to update our model so that the TMDL serialization does not include metadata order, but the annotation value is lost when saving the model.

Steps to Reproduce

I didn't know what value to set in TabularEditor_SerializeOptions, so I updated the properties via TE2. When I open in TE3, the value is set to:

{"IgnoreInferredObjects":true,"IgnoreInferredProperties":true,"IgnoreTimestamps":true,"SplitMultilineStrings":true,"PrefixFilenames":false,"LocalTranslations":false,"LocalPerspectives":false,"LocalRelationships":false,"Levels":["Data Sources","Shared Expressions","Perspectives","Relationships","Roles","Tables","Tables/Calculation Items","Tables/Columns","Tables/Hierarchies","Tables/Measures","Tables/Partitions","Translations"],"TmdlOptions":{"IncludeRefs":false}}

When I make any change to the model and save it, this annotation changes to:

{"IgnoreInferredObjects":true,"IgnoreInferredProperties":true,"IgnoreTimestamps":true,"SplitMultilineStrings":true,"PrefixFilenames":false,"LocalTranslations":false,"LocalPerspectives":false,"LocalRelationships":false,"Levels":["Data Sources","Perspectives","Relationships","Roles","Shared Expressions","Tables","Tables/Calculation Items","Tables/Columns","Tables/Hierarchies","Tables/Measures","Tables/Partitions","Translations"]}

The IncludeRefs value is removed.

How can I get the IncludeRefs part to stay? We would prefer to just not have the refs at all - we generate child models from the master and sometimes the order will change, so we get unnecessary updates to the model.tmdl child files.

Expected behavior

IncludeRefs part of the annotation stays when saving the model.

Crash Report

No response

Windows Version

Windows 11 Pro

mlonsk commented 3 weeks ago

Hi @ScottThompsonNH I am not able to reproduce the behavior you describe. Tabular Editor 3 do use the same annotations as Tabular Editor 2, but the TMDL specific annotations are only set once they differ from the standard.

I did notice one thing while testing that is a bug and perhaps can explain what you are seeing. Neither Tabular Editor 2 nor 3 save changed serialization annotations when just save an existing model using CTRL+S, you have to use the Files > 'Save To Folder' to materialize the changes in the model.tmdl file.

A quick note on Tabular Editor 3 serialization, as there are actually two places that controls the serilization of a specific model. In Preferences>File Formats > Save-to-folder you have the general settings for the application. But for the individual model that is already saved you need to use the Model>Serilization options... to change the serilization settings on the model.tmdl file.

Preferences>File Formats > Save-to-folder image

Model>Serilization

image
ScottThompsonNH commented 3 weeks ago

Ah, in TE3, I was changing the annotation directly, not via menu (duh).

I do see something that seems inconsistent between TE2 and TE3. In TE3, when I check the metadata order flag, it sets the annotation string to "IncludeRefs":true. When I uncheck it, that part of the annotation string is just removed, rather than setting it to "IncludeRefs":false.

But in TE2, the opposite seems to be true. Checking the flag removes that part of the annotation, while unchecking it sets the annotation to "IncludeRefs":false.

mlonsk commented 3 weeks ago

Hi @ScottThompsonNH When I open the same model in TE2 (2.24.1) and TE3 (3.15.0), I see the same settings for both models.

image

Could you try to open side by side as well to see if it looks different to you?

ScottThompsonNH commented 3 weeks ago

Hi Morten,

It looks like you are not on the "Current Model" tab of TE2? I am on TE2 2.24.0 and TE3 3.14.0. I can update if there's reason to believe that the new versions will make a difference (we try to update all developers at once), but in my versions they don't look the same

Same model, flag is different: image

The text of the annotation is: {"IgnoreInferredObjects":true,"IgnoreInferredProperties":true,"IgnoreTimestamps":true,"SplitMultilineStrings":true,"PrefixFilenames":false,"LocalTranslations":false,"LocalPerspectives":false,"LocalRelationships":false,"Levels":["Data Sources","Perspectives","Relationships","Roles","Shared Expressions","Tables","Tables/Calculation Items","Tables/Columns","Tables/Hierarchies","Tables/Measures","Tables/Partitions","Translations"],"TmdlOptions":{"ExpressionTrimStyle":"TrimTrailingWhitespaces"}}

mlonsk commented 3 weeks ago

Hi Scott

You are quite right, I attached the wrong screenshot. Sorry about that.

I have tried to recreate what I see in the bellow video and on my end the settings do synchronize, but I have to reopen the model to load in the new settings in the other program.

Could you describe the process you take to get the divergent settings that you see?

Thank you

ScottThompsonNH commented 2 weeks ago

Hi Morten,

I can't see the video, but here are some exact steps to reproduce.

Create a brand new model in TE2. Set it to TMDL Save to Folder and uncheck the metadata order flag. Here are the contents of my files:

database.tmdl: database SemanticModel compatibilityLevel: 1605 compatibilityMode: powerBI

model.tmdl: model Model defaultPowerBIDataSourceVersion: powerBI_V3

annotation TabularEditor_SerializeOptions = {"IgnoreInferredObjects":true,"IgnoreInferredProperties":true,"IgnoreTimestamps":true,"SplitMultilineStrings":true,"PrefixFilenames":false,"LocalTranslations":false,"LocalPerspectives":false,"LocalRelationships":false,"Levels":["Data Sources","Shared Expressions","Perspectives","Relationships","Roles","Tables","Tables/Calculation Items","Tables/Columns","Tables/Hierarchies","Tables/Measures","Tables/Partitions","Translations"],"TmdlOptions":{"IncludeRefs":false}}

annotation __TEdtr = 1

Open the model in TE3. At this point nothing has changed and the metadata order flag is still unchecked. Make some small change to the model. I updated the model description to "Test". Save the model. Close it and reopen. Now the metadata order flag is checked and the annotation has changed.

model.tmdl: /// Test model Model defaultPowerBIDataSourceVersion: powerBI_V3

annotation TabularEditor_SerializeOptions = {"IgnoreInferredObjects":true,"IgnoreInferredProperties":true,"IgnoreTimestamps":true,"SplitMultilineStrings":true,"PrefixFilenames":false,"LocalTranslations":false,"LocalPerspectives":false,"LocalRelationships":false,"Levels":[]}

annotation __TEdtr = 1

It seems like TE3 does not save the "IncludeRefs":false part of the annotation.

mlonsk commented 2 weeks ago

Hi @ScottThompsonNH Thank you for the explanation and sorry about the video, seems like something went wrong in the upload. I will try to reproduce it this week and get back to you.

mlonsk commented 1 week ago

Hi @ScottThompsonNH I have reproduced the issue as well thanks to your description. Thank you. We are treating this as a critical bug in Tabular Editor 3 and are aiming to have a fix included in our next release. Thank you for your patience in helping us identify the issue.