tinybird 0.0.1.dev102__py3-none-any.whl → 0.0.1.dev103__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tinybird might be problematic. Click here for more details.

@@ -651,6 +651,12 @@ Ready? """
651
651
  warning_tag_remove = prompt_message(
652
652
  "Tag {tag_name} is used by {resources_len} resources. Do you want to remove it?"
653
653
  )
654
+ warning_bigquery_connector_deprecated = warning_message(
655
+ "🚨🚨🚨 [DEPRECATED] BigQuery connector is deprecated. Use ingestion from GCS instead. https://www.tinybird.co/docs/get-data-in/guides/ingest-from-bigquery-using-google-cloud-storage **"
656
+ )
657
+ warning_s3_access_key_secret_deprecated = warning_message(
658
+ "🚨🚨🚨 [DEPRECATED] S3 (Access Key + Secret) connector is deprecated. Use S3 IAM role instead. https://www.tinybird.co/docs/get-data-in/connectors/s3 **"
659
+ )
654
660
 
655
661
  info_fixtures_branch = info_message("** Data Fixtures are only pushed to Branches")
656
662
  info_materialize_push_datasource_exists = warning_message("** Data Source {name} already exists")
tinybird/tb/__cli__.py CHANGED
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
4
4
  __url__ = 'https://www.tinybird.co/docs/cli/introduction.html'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '0.0.1.dev102'
8
- __revision__ = '627c8ef'
7
+ __version__ = '0.0.1.dev103'
8
+ __revision__ = 'e2e3b60'
@@ -55,7 +55,7 @@ jobs:
55
55
  - name: Test project
56
56
  run: tb test run
57
57
  - name: Deployment check
58
- run: tb --cloud --host ${{! TINYBIRD_HOST }} --token ${{! TINYBIRD_TOKEN }} deploy --check
58
+ run: tb --cloud --host ${{! env.TINYBIRD_HOST }} --token ${{! env.TINYBIRD_TOKEN }} deploy --check
59
59
  """
60
60
 
61
61
 
@@ -158,47 +158,6 @@ async def pull(ctx: Context, force: bool, fmt: bool) -> None:
158
158
  return await folder_pull(client, project.path, force, fmt=fmt)
159
159
 
160
160
 
161
- @cli.command(hidden=True)
162
- @click.option("--no-deps", is_flag=True, default=False, help="Print only data sources with no pipes using them")
163
- @click.option("--match", default=None, help="Retrieve any resource matching the pattern")
164
- @click.option("--pipe", default=None, help="Retrieve any resource used by pipe")
165
- @click.option("--datasource", default=None, help="Retrieve resources depending on this data source")
166
- @click.option(
167
- "--check-for-partial-replace",
168
- is_flag=True,
169
- default=False,
170
- help="Retrieve dependant data sources that will have their data replaced if a partial replace is executed in the data source selected",
171
- )
172
- @click.option("--recursive", is_flag=True, default=False, help="Calculate recursive dependencies")
173
- @click.pass_context
174
- @coro
175
- async def dependencies(
176
- ctx: Context,
177
- no_deps: bool,
178
- match: Optional[str],
179
- pipe: Optional[str],
180
- datasource: Optional[str],
181
- check_for_partial_replace: bool,
182
- recursive: bool,
183
- ) -> None:
184
- """Print all data sources dependencies."""
185
-
186
- client = ctx.ensure_object(dict)["client"]
187
-
188
- response = await client.datasource_dependencies(
189
- no_deps, match, pipe, datasource, check_for_partial_replace, recursive
190
- )
191
- for ds in response["dependencies"]:
192
- click.echo(FeedbackManager.info_dependency_list(dependency=ds))
193
- for pipe in response["dependencies"][ds]:
194
- click.echo(FeedbackManager.info_dependency_list_item(dependency=pipe))
195
- if "incompatible_datasources" in response and len(response["incompatible_datasources"]):
196
- click.echo(FeedbackManager.info_no_compatible_dependencies_found())
197
- for ds in response["incompatible_datasources"]:
198
- click.echo(FeedbackManager.info_dependency_list(dependency=ds))
199
- raise CLIException(FeedbackManager.error_partial_replace_cant_be_executed(datasource=datasource))
200
-
201
-
202
161
  @cli.command(
203
162
  name="diff",
204
163
  short_help="Diff local datafiles to the corresponding remote files in the workspace. Only diffs VERSION and SCHEMA for .datasource files.",
@@ -1984,12 +1984,12 @@ async def send_batch_events(
1984
1984
  click.echo(FeedbackManager.highlight(message=f"» {rows} rows x {cols} cols in {elapsed_time:.1f}s"))
1985
1985
 
1986
1986
 
1987
- async def get_organizations_by_user(config: CLIConfig, user_token: str) -> List[Dict[str, Any]]:
1987
+ async def get_organizations_by_user(config: CLIConfig, user_token: Optional[str] = None) -> List[Dict[str, str]]:
1988
1988
  """Fetches all organizations by user using the provided user token"""
1989
1989
  organizations = []
1990
1990
 
1991
1991
  try:
1992
- user_client = config.get_client(token=user_token)
1992
+ user_client = config.get_client(token=user_token) if user_token else config.get_user_client()
1993
1993
  user_workspaces = await user_client.user_workspaces_with_organization(version="v1")
1994
1994
  admin_org_id = user_workspaces.get("organization_id")
1995
1995
  seen_org_ids = set()
@@ -2089,7 +2089,7 @@ async def ask_for_organization_name(config: CLIConfig) -> str:
2089
2089
  user_email.split("@")[0] if user_email else None
2090
2090
  ) # Example: "jane.doe@gmail.com" -> "jane.doe"
2091
2091
  return click.prompt(
2092
- "\nYou need to create an organization to continue. We will include your existing workspaces in it.\nThis operation will only happen once and then your new workspaces will be automatically included in your organization.\n\nEnter organization name",
2092
+ "\nYou need to create an organization to continue.\nEnter organization name",
2093
2093
  hide_input=False,
2094
2094
  show_default=True,
2095
2095
  default=default_organization_name,
@@ -2166,3 +2166,51 @@ def get_ui_url(api_host: str) -> str:
2166
2166
  return f"https://cloud.tinybird.co/{cloud}/{region}"
2167
2167
 
2168
2168
  return api_host
2169
+
2170
+
2171
+ async def ask_for_organization(
2172
+ organizations: Optional[List[Dict[str, Any]]],
2173
+ organization_id: Optional[str] = None,
2174
+ user_token: Optional[str] = None,
2175
+ ) -> Tuple[Optional[str], Optional[str]]:
2176
+ config = CLIConfig.get_project_config()
2177
+ user_email = config.get_user_email()
2178
+
2179
+ if organization_id:
2180
+ if organizations and len(organizations) > 0:
2181
+ organization = next(
2182
+ (org for org in organizations if org.get("id") == organization_id), None
2183
+ )
2184
+ if not organization:
2185
+ raise CLIException(
2186
+ FeedbackManager.error_organization_not_found(
2187
+ organization_id=organization_id
2188
+ )
2189
+ )
2190
+ organization_name = organization.get("name")
2191
+ return organization_id, organization_name
2192
+
2193
+ if organizations is None or len(organizations) == 0:
2194
+ organization_name = await ask_for_organization_name(config)
2195
+ user_token = await get_user_token(config, user_token)
2196
+ organization = await create_organization_and_add_workspaces(
2197
+ config, organization_name, user_token
2198
+ )
2199
+ organization_id = organization.get("id")
2200
+ else:
2201
+ if len(organizations) == 1:
2202
+ organization_name = organizations[0]["name"]
2203
+ organization_id = organizations[0]["id"]
2204
+ else:
2205
+ sorted_organizations = sort_organizations_by_user(
2206
+ organizations, user_email=user_email
2207
+ )
2208
+ current_organization = await ask_for_organization_interactively(
2209
+ sorted_organizations
2210
+ )
2211
+ if current_organization:
2212
+ organization_id = current_organization.get("id")
2213
+ organization_name = current_organization.get("name")
2214
+ else:
2215
+ return None, None
2216
+ return organization_id, organization_name
@@ -299,9 +299,9 @@ def init_git(folder: str):
299
299
  if gitignore_file.exists():
300
300
  content = gitignore_file.read_text()
301
301
  if ".tinyb" not in content:
302
- gitignore_file.write_text(content + "\n.tinyb\n")
302
+ gitignore_file.write_text(content + "\n.tinyb\n.terraform\n")
303
303
  else:
304
- gitignore_file.write_text(".tinyb\n")
304
+ gitignore_file.write_text(".tinyb\n.terraform\n")
305
305
 
306
306
  click.echo(FeedbackManager.info_file_created(file=".gitignore"))
307
307
  except Exception as e:
@@ -1464,6 +1464,8 @@ def parse(
1464
1464
  "kafka_security_protocol": assign_var("kafka_security_protocol"),
1465
1465
  "kafka_sasl_mechanism": assign_var("kafka_sasl_mechanism"),
1466
1466
  "import_service": assign_var("import_service"),
1467
+ "s3_region": assign_var("s3_region"),
1468
+ "s3_arn": assign_var("s3_arn"),
1467
1469
  "import_connection_name": assign_var("import_connection_name"),
1468
1470
  "import_schedule": assign_var("import_schedule"),
1469
1471
  "import_strategy": assign_var("import_strategy"),