The Instance object has a method table() which only takes a table id, but not an app profile. This means it's not possible to create a Table object given an instance to be used with app profiles, even though the Table object constructor does take an optional app profile parameter.
Thus, instead of a simple quickstart as follows:
from google.cloud import bigtable
# Warning: this code doesn't work (yet)
client = bigtable.Client(project=project_id)
instance = client.instance(instance_id)
table = instance.table(table_id, app_profile_id) # clean, simple; alas, does not work
we have to do something slightly round-about:
from google.cloud import bigtable
client = bigtable.Client(project=project_id)
instance = client.instance(instance_id)
table = bigtable.table.Table(table_id, instance, app_profile_id) # awkward
Proposal: extend Instance#table() to take an optional app_profile_id parameter that would be forwarded to the Table constructor and hence allow the simpler code pattern above.
Thoughts?
/cc: @sduskis, @billyjacobson, @jabubake, @ghaisa
Basically, instasnce.table() needs an optional app_profile_id parameter.
FTR, closed via #5605.
Most helpful comment
FTR, closed via #5605.