Skip to content
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

fix some bugs #6

Merged
merged 3 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 2 deletions bqemulatormanager/emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ def __init__(self, project_name: str, port: int, launch_emulator: bool = True, d
if is_port_in_use(port):
raise PortOccupiedError(f'port {port} is occupied.')
self.running_flg = True
self.proc = subprocess.Popen(["bigquery-emulator", "--project", f"{project_name}", "--port", f"{port}"
"--log-level", f"{log_level}"], shell=True)
self.proc = subprocess.Popen(["bigquery-emulator", "--project", f"{project_name}", "--port", f"{port}", "--log-level", f"{log_level}"], shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-format only, right ?

Copy link
Member Author

@kitagry kitagry May 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there was not , between f"{port}" and "--log-level".


def __del__(self):
if self.running_flg:
Expand Down
2 changes: 1 addition & 1 deletion bqemulatormanager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def load(self, data, path):

def create_dataset(self, dataset_name: str, exists_ok=True):
dataset = bigquery.Dataset(f'{self.project_name}.{dataset_name}')
self.client.create_dataset(dataset)
self.client.create_dataset(dataset, exists_ok=exists_ok)
hirosassa marked this conversation as resolved.
Show resolved Hide resolved
self.structure[dataset_name] = {}

def create_table(self, dataset_name: str, table_name: str, schema: List[bigquery.SchemaField]):
Expand Down