Skip to content

Resolve errors encountered on Qwicklabs(GSP439) #145

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions 04_streaming/simulate/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
google-cloud-pubsub
google-cloud-bigquery
pytz
3 changes: 2 additions & 1 deletion 04_streaming/simulate/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ def compute_sleep_secs(notify_time):
parser.add_argument('--project', help='your project id, to create pubsub topic', required=True)
parser.add_argument('--speedFactor', help='Example: 60 implies 1 hour of data sent to Cloud Pub/Sub in 1 minute', required=True, type=float)
parser.add_argument('--jitter', help='type of jitter to add: None, uniform, exp are the three options', default='None')
parser.add_argument('--tableName', help='Big Query table name e.g. mydatasetname.mytable', default='dsongcp.flights_simevents')

# set up BigQuery bqclient
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
args = parser.parse_args()
bqclient = bq.Client(args.project)
bqclient.get_table('dsongcp.flights_simevents') # throws exception on failure
bqclient.get_table(args.tableName) # throws exception on failure

# jitter?
if args.jitter == 'exp':
Expand Down