Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResolveObjectPath always returns null #1077

Closed
o-o00o-o opened this issue Feb 7, 2023 · 4 comments
Closed

ResolveObjectPath always returns null #1077

o-o00o-o opened this issue Feb 7, 2023 · 4 comments
Labels
bug Anything that is supposed to work, but doesn't.
Milestone

Comments

@o-o00o-o
Copy link

o-o00o-o commented Feb 7, 2023

Describe the bug
ResolveObjectPath always returns null

To Reproduce

  • Create a model with a Dates table and a Date column
  • run c# script ```ResolveObjectPath("Model.Dates.Date").Output();````
  • See output shows null
  • Expected to return the column found

image

Expected behavior

  • Expected to return the Dates[date] column found

Observed behavior
null returned

Application specifics

  • Tabular Editor 2.X version: v2.17.2
  • Semantic Engine used: N/A
  • Model Compatibility Level 1500

Additional context
This used to work fine but not sure when in the last couple of years exactly when it broke as the affected code is not regularly run on our system

@o-o00o-o o-o00o-o added the bug Anything that is supposed to work, but doesn't. label Feb 7, 2023
@otykier
Copy link
Collaborator

otykier commented Feb 7, 2023

I believe we changed the path structure a while back, to account for ambiguity. Try changing the string to:

Model.T.Dates.C.Date

or call GetObjectPath() on an object to see what it returns.

@o-o00o-o
Copy link
Author

o-o00o-o commented Feb 7, 2023

Yes, Model.T.Dates.C.Date works but this presents the code with a new problem - I don't know implicitly whether it is a Column or a Measure being referred to (and I didn't need to know).

What was the ambiguity that this was to resolve? It doesn't seem possible to have a measure and a column in the same table with the same name.

Any chance of providing a backward compatible version that will work as the previous one did (accepting that if it gets a conflict it will exception?). I guess the alternative is that I would need to try both T.X.C.Y and then if null returned try T.X.M.Y ..

@otykier
Copy link
Collaborator

otykier commented Feb 8, 2023

A hierarchy on a table can have the same name as a measure. Partitions on a table can have the same names as columns, measures and hierarchies. Perspectives can have the same names as tables, and so can roles, etc. etc.

When there is no ambiguity, I guess we can support both path formats in calls to ResolveObjectPath(), however we will have to stick to the new format when calling GetObjectPath().

@otykier
Copy link
Collaborator

otykier commented Feb 24, 2023

2.17.3 now lets ResolveObjectPath() work with the "old format", i.e. paths such as: Model.Dates.Date.

@otykier otykier closed this as completed Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Anything that is supposed to work, but doesn't.
Projects
None yet
Development

No branches or pull requests

2 participants