Adding job labels for FinOps#673
Conversation
|
Would you mind pointing me to the BigQuery docs for labels? In the interest of using the simplest possible data structure, is there a reason to use a list instead of a named character vector? |
Here are the docs: https://docs.cloud.google.com/bigquery/docs And you are correct, the list was unnecessary. I have changed that to a named chr vector. |
|
Adding my support for this feature – it is important for cost allocation in production applications that use R to communicate with BigQuery. |
hadley
left a comment
There was a problem hiding this comment.
Thanks for working on this! A few comments on the overall approach and implementation below.
I assume you have tested this interactively?
Ofc, thank you the comments! We use this every day, but I have now tested it more thoroughly. I had to change the character vector back to list - i hadn't tested that change well enough. |
9ffeefa to
79cc026
Compare
|
@JulianUmbhau could you please double check that my changes haven't broken anything for you? |
|
@JulianUmbhau I'm going to release early next week so I'd really appreciate a look if you have the time 😄 |
…s and tests for check_labels function
…eck_labels and corrected tests
Added labels to job creation calls for FinOps purposes
Labels can be set globally via:
options(bigrquery.labels = list(env = "prod", team = "analytics"))
Labels are then automatically attached to all BigQuery job requests (query, load, extract, copy).
Fixes #652