-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Bigtable: Create snippets bigtable table.py #6484
Conversation
@sduskis Please review the snippets. |
bigtable/docs/snippets.py
Outdated
instance = client.instance(INSTANCE_ID) | ||
|
||
table = instance.table("table_id1_samplerow") | ||
table.create() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
bigtable/docs/snippets.py
Outdated
assert column_family_id in col_fams | ||
|
||
|
||
def test_bigtable_mutations_batcher_read_rows(): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
bigtable/docs/snippets.py
Outdated
expected_rows_data.append(row.decode('utf-8')) | ||
expected_rows_data.append(cell_val.decode('utf-8')) | ||
|
||
# [START bigtable_mutate_rows] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
bigtable/docs/snippets.py
Outdated
table_name = table.name | ||
# [END bigtable_table_name] | ||
|
||
cred = os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', 'project_id') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
bigtable/docs/snippets.py
Outdated
actual_keys, offset = zip(*[(rk.row_key, rk.offset_bytes) for rk in data]) | ||
# [END bigtable_sample_row_keys] | ||
initial_split_keys.append(b'') | ||
assert actual_keys == initial_split_keys |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
When I run test locally I get an error |
I am running on emulators, so worked fine. My rpc calls are broken so unable to test on cloud. |
After consulting with @sduskis, it looks like it might have something to do with the instance becoming replicated. As such, switching tests around seems to fix the problem. Please move |
If this suggestion is agreed with. Please create separate |
If that's the case then it looks ideal for creating separate snippets files for instance admin and table admin. In which case, there would be separate setup and teardown. which would handle new instance for separate files. |
Bigtable gets its noxfile from the synthtool templates. You will want to alter the last line of synth.py from
|
@crwilcox |
@tseaver could you please review this code? |
bigtable/noxfile.py
Outdated
|
||
@nox.session(python=['2.7', '3.7']) | ||
def snippets(session): | ||
"""Run the system test suite.""" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
bigtable/noxfile.py
Outdated
@nox.session(python=['2.7', '3.7']) | ||
def snippets(session): | ||
"""Run the system test suite.""" | ||
# Sanity check: Only run system tests if the environment variable is set. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
My two requested changes are minor. Merge when CI is green after making them. |
@sduskis Thank you for update. My apologies, I missed the notification. |
Create snippets for table.py