Hello all,
I have been trying to figure out this error message below. I am following the Dataform documentation but somehow keep getting this error when I try to use a .js constant for the project name for my table name in the .sqlx file.
My .js file is at includes/constants.js and this is the content:
const load_project = "project_name";
module.exports = { load_project };
Funny thing is that, this code was working fine and started throwing this error today when I started working on this code further. I found similar question in stackoverflow which was also not answered.
Solved! Go to Solution.
Are you sure that you have a constant `load_project` defined? `Access Denied: Table` is a misleading error message since `undefined:heroku_coachdb.attendees` is not a real table because `undefined` is not a real project.
If you are sure that you got the spelling right, I would suggest you recreate the constant in a new line and delete the previous line. It's a weird bug but I've seen these things happen especially when copy-pasting.
You are right; this should be working. Did you make any recent changes to your workflow_settings.yaml? If you did, try to press "INSTALL PACKAGES" again. If error persists, can you send a screenshot of your workspace directory structure?
Thanks for the reply. Though I hadnt done any changes to the .yaml file, I installed the packages again but the problem persists. Is this screenshot useful?
I am only using the slowly changing dimensions package from Dataform additionally.
The only plausible explanation I can think of is you got the spelling of your constant wrong. Although your example shows the same spelling in your constants file and your sqlx file, it may have been changed accidentally while doing other edits.
Hi @kccanut,
Welcome to the Google Cloud Community!
You can check the following that might help resolve the error you're encountering:
{
"projectRoot": "./" //Or the path to your includes directory, depending on your setup
}
I hope the above information is helpful.
Thanks for your reply. I think I am quite new thus couldnt follow your first point. I have a workflow_settings.yaml file and use Dataform 3.0.8 (the latest version) When I add projectRoot to the yaml file, it does not get recognized. I get this error:
"Uncaught ReferenceError: Workflow settings error: Unexpected property "projectRoot", or property value type of "string" is incorrect. See https://dataform-co.github.io/dataform/docs/configs-reference#dataform-WorkflowSettings for allowed properties."
The service account has the bigquery roles you mentioned. I use databaselocation = eu. So other points look fine to me.
Lastly, I can actually call the javascript variables in my code. Here is an example where it works with one instance and doesnt work with the other one.
Are you sure that you have a constant `load_project` defined? `Access Denied: Table` is a misleading error message since `undefined:heroku_coachdb.attendees` is not a real table because `undefined` is not a real project.
If you are sure that you got the spelling right, I would suggest you recreate the constant in a new line and delete the previous line. It's a weird bug but I've seen these things happen especially when copy-pasting.
When I recreated the constant in a new line with just copy pasting, it worked. Wow! Thanks a lot!