Mismatch between table names in schema and dumps?

Jump to solution
ColinMurtaugh
Community Champion

Hi --

Apologies if this has been discussed before, but there are a number of tables whose names in the schema JSON don't match the table names in the other data returned by the API. For example, the 'course' table in the schema is called 'course_dim' everywhere else; same for 'account'/'account_dim', 'user'/'user_dim', etc. 

Is there any way these inconsistencies can be fixed? 

Thanks --

Colin

0 Likes
1 Solution
James
Community Champion

50581462, I've read this a couple of times and I've got to admit I wasn't sure what you were asking for until I started writing the response. Hopefully I ended up getting it right.

The three you mention don't have a corresponding _fact table, so there is only one course, account, and user table (course_dim, account_dim, and user_dim). In every other case, there are two tables, so you can't just say the assignment table, because you wouldn't know which one (_dim or _fact) you were talking about. Therefore, the top-level property must contain distinguishing text (like _dim or _fact) that make it identifiable. But it could have just as easily have been an array and not had an identifier in there at all.

I can see why it was done this way and can see benefits to having it this way. If the key off the root object was course_dim, one might expect that there was a corresponding course_fact, but there is not.

The key that I think you're talking about isn't the field you should be using for the table name anyway. There is a tableName field that contains the name of the table. What the other one is called is really irrelevant and shouldn't be relied upon.

I will say that when I was first programming for it, I wanted the top level to be the table name, but once I discovered the tableName field and understood what was going on, I was fine.

One area I can see it might matter is if you're fetching individual tables through the CLI. I don't do that, so I don't know whether you fetch based off the tableName or the top-level property, but a name mismatch there might be confusing. Otherwise it seems like extra typing when it's not necessary.

I'd much rather have the spelling on requests.web_applicaiton_action fixed. The comment there says "(There is a typo in the field name, in order to minimize impact, this will be changed in a future version of Canvas Data.)" and it's been that way for a long time. If changing the name on a field in a requests table is going impact a lot, then I wonder what changing the top level property would do.

View solution in original post