tinybird 0.0.1.dev136__tar.gz → 0.0.1.dev138__tar.gz

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.

Files changed (108) hide show
  1. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/__cli__.py +2 -2
  3. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/build.py +5 -0
  4. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/cli.py +10 -19
  5. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/infra.py +1 -1
  6. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/local_common.py +4 -4
  7. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/shell.py +1 -1
  8. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird.egg-info/PKG-INFO +1 -1
  9. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/setup.cfg +0 -0
  10. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/__cli__.py +0 -0
  11. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/ch_utils/constants.py +0 -0
  12. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/ch_utils/engine.py +0 -0
  13. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/check_pypi.py +0 -0
  14. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/client.py +0 -0
  15. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/config.py +0 -0
  16. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/connectors.py +0 -0
  17. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/context.py +0 -0
  18. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/datafile.py +0 -0
  19. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/datatypes.py +0 -0
  20. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/feedback_manager.py +0 -0
  21. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/git_settings.py +0 -0
  22. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/prompts.py +0 -0
  23. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/sql.py +0 -0
  24. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/sql_template.py +0 -0
  25. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/sql_template_fmt.py +0 -0
  26. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/sql_toolset.py +0 -0
  27. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/syncasync.py +0 -0
  28. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/cli.py +0 -0
  29. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/client.py +0 -0
  30. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/config.py +0 -0
  31. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/auth.py +0 -0
  32. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/cicd.py +0 -0
  33. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/common.py +0 -0
  34. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/config.py +0 -0
  35. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/connection.py +0 -0
  36. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/copy.py +0 -0
  37. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/create.py +0 -0
  38. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/build.py +0 -0
  39. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/build_common.py +0 -0
  40. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  41. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  42. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/common.py +0 -0
  43. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/diff.py +0 -0
  44. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/exceptions.py +0 -0
  45. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/fixture.py +0 -0
  46. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/format_common.py +0 -0
  47. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  48. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  49. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
  50. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
  51. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  52. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/playground.py +0 -0
  53. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datafile/pull.py +0 -0
  54. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/datasource.py +0 -0
  55. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/deployment.py +0 -0
  56. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/endpoint.py +0 -0
  57. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/exceptions.py +0 -0
  58. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/feedback_manager.py +0 -0
  59. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/job.py +0 -0
  60. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/llm.py +0 -0
  61. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/llm_utils.py +0 -0
  62. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/local.py +0 -0
  63. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/login.py +0 -0
  64. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/logout.py +0 -0
  65. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/materialization.py +0 -0
  66. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/mock.py +0 -0
  67. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/open.py +0 -0
  68. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/pipe.py +0 -0
  69. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/project.py +0 -0
  70. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/regions.py +0 -0
  71. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/secret.py +0 -0
  72. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/table.py +0 -0
  73. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/tag.py +0 -0
  74. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/telemetry.py +0 -0
  75. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/test.py +0 -0
  76. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  77. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  78. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/token.py +0 -0
  79. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/watch.py +0 -0
  80. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/workspace.py +0 -0
  81. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb/modules/workspace_members.py +0 -0
  82. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli.py +0 -0
  83. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/auth.py +0 -0
  84. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/branch.py +0 -0
  85. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/cicd.py +0 -0
  86. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/cli.py +0 -0
  87. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/common.py +0 -0
  88. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/config.py +0 -0
  89. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/connection.py +0 -0
  90. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/datasource.py +0 -0
  91. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/exceptions.py +0 -0
  92. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/fmt.py +0 -0
  93. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/job.py +0 -0
  94. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/pipe.py +0 -0
  95. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/regions.py +0 -0
  96. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/tag.py +0 -0
  97. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/telemetry.py +0 -0
  98. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/test.py +0 -0
  99. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  100. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  101. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/workspace.py +0 -0
  102. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  103. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird/tornado_template.py +0 -0
  104. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird.egg-info/SOURCES.txt +0 -0
  105. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird.egg-info/dependency_links.txt +0 -0
  106. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird.egg-info/entry_points.txt +0 -0
  107. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird.egg-info/requires.txt +0 -0
  108. {tinybird-0.0.1.dev136 → tinybird-0.0.1.dev138}/tinybird.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev136
3
+ Version: 0.0.1.dev138
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -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.dev136'
8
- __revision__ = 'c7efbae'
7
+ __version__ = '0.0.1.dev138'
8
+ __revision__ = '7227da7'
@@ -193,6 +193,11 @@ def append_fixture(
193
193
  datasource_name: str,
194
194
  url: str,
195
195
  ):
196
+ # Append fixtures only if the datasource is empty
197
+ data = asyncio.run(tb_client._req(f"/v0/datasources/{datasource_name}"))
198
+ if data.get("statistics", {}).get("row_count", 0) > 0:
199
+ return
200
+
196
201
  asyncio.run(
197
202
  push_data(
198
203
  tb_client,
@@ -63,7 +63,6 @@ VERSION = f"{__cli__.__version__} (rev {__cli__.__revision__})"
63
63
  @click.option("--host", help="Use custom host, defaults to TB_HOST envvar, then to https://api.tinybird.co")
64
64
  @click.option("--show-tokens", is_flag=True, default=False, help="Enable the output of tokens.")
65
65
  @click.option("--cloud/--local", is_flag=True, default=False, help="Run against cloud or local.")
66
- @click.option("--build", is_flag=True, default=False, help="Run against build mode.")
67
66
  @click.option("--staging", is_flag=True, default=False, help="Run against a staging deployment.")
68
67
  @click.version_option(version=VERSION)
69
68
  @click.pass_context
@@ -76,14 +75,13 @@ async def cli(
76
75
  host: str,
77
76
  show_tokens: bool,
78
77
  cloud: bool,
79
- build: bool,
80
78
  staging: bool,
81
79
  ) -> None:
82
80
  """
83
81
  Use `OBFUSCATE_REGEX_PATTERN` and `OBFUSCATE_PATTERN_SEPARATOR` environment variables to define a regex pattern and a separator (in case of a single string with multiple regex) to obfuscate secrets in the CLI output.
84
82
  """
85
83
  # We need to unpatch for our tests not to break
86
- if show_tokens or not cloud or ctx.invoked_subcommand == "build" or build:
84
+ if show_tokens or not cloud or ctx.invoked_subcommand == "build":
87
85
  __unpatch_click_output()
88
86
  else:
89
87
  __patch_click_output()
@@ -139,13 +137,13 @@ async def cli(
139
137
  if "--help" in sys.argv or "-h" in sys.argv:
140
138
  return
141
139
 
142
- client = await create_ctx_client(ctx, config, cloud, build, staging)
140
+ client = await create_ctx_client(ctx, config, cloud, staging)
143
141
 
144
142
  if client:
145
143
  ctx.ensure_object(dict)["client"] = client
146
144
 
147
145
  ctx.ensure_object(dict)["project"] = project
148
- ctx.ensure_object(dict)["env"] = get_target_env(cloud, build)
146
+ ctx.ensure_object(dict)["env"] = get_target_env(cloud)
149
147
 
150
148
 
151
149
  @cli.command(hidden=True)
@@ -295,35 +293,28 @@ def __unpatch_click_output():
295
293
  click.secho = __old_click_secho
296
294
 
297
295
 
298
- async def create_ctx_client(ctx: Context, config: Dict[str, Any], cloud: bool, build: bool, staging: bool):
296
+ async def create_ctx_client(ctx: Context, config: Dict[str, Any], cloud: bool, staging: bool):
299
297
  commands_without_ctx_client = ["auth", "check", "local", "login", "logout", "update", "upgrade"]
300
298
  command = ctx.invoked_subcommand
301
299
  if command in commands_without_ctx_client:
302
300
  return None
303
301
 
304
302
  commands_always_cloud = ["pull", "infra"]
305
- commands_always_build = ["build", "test", "dev", "create"]
306
- commands_always_local: List[str] = []
307
- if (
308
- (cloud or command in commands_always_cloud)
309
- and command not in commands_always_local
310
- and command not in commands_always_build
311
- ):
303
+ commands_always_local = ["build", "test", "dev", "create"]
304
+ if (cloud or command in commands_always_cloud) and command not in commands_always_local:
312
305
  click.echo(
313
306
  FeedbackManager.gray(message=f"Running against Tinybird Cloud: Workspace {config.get('name', 'default')}")
314
307
  )
315
308
  return _get_tb_client(config.get("token", None), config["host"], staging=staging)
316
- build = command in commands_always_build or build
317
- if not build and command not in commands_always_local and command not in commands_always_build:
309
+ local = command in commands_always_local
310
+ if not local and command not in commands_always_local and command:
318
311
  click.echo(FeedbackManager.gray(message="Running against Tinybird Local"))
319
- return await get_tinybird_local_client(config, build=build, staging=staging)
312
+ return await get_tinybird_local_client(config, staging=staging)
320
313
 
321
314
 
322
- def get_target_env(cloud: bool, build: bool) -> str:
315
+ def get_target_env(cloud: bool) -> str:
323
316
  if cloud:
324
317
  return "cloud"
325
- if build:
326
- return "build"
327
318
  return "local"
328
319
 
329
320
 
@@ -313,7 +313,7 @@ class Infrastructure:
313
313
  return []
314
314
 
315
315
 
316
- @cli.group(hidden=True)
316
+ @cli.group()
317
317
  @click.pass_context
318
318
  def infra(ctx: Context) -> None:
319
319
  """Infra commands."""
@@ -16,14 +16,14 @@ TB_LOCAL_PORT = int(os.getenv("TB_LOCAL_PORT", 7181))
16
16
  TB_LOCAL_HOST = f"http://localhost:{TB_LOCAL_PORT}"
17
17
 
18
18
 
19
- async def get_tinybird_local_client(config_obj: Dict[str, Any], build: bool = False, staging: bool = False) -> TinyB:
19
+ async def get_tinybird_local_client(config_obj: Dict[str, Any], staging: bool = False) -> TinyB:
20
20
  """Get a Tinybird client connected to the local environment."""
21
21
 
22
- config = await get_tinybird_local_config(config_obj, build=build)
22
+ config = await get_tinybird_local_config(config_obj)
23
23
  return config.get_client(host=TB_LOCAL_HOST, staging=staging)
24
24
 
25
25
 
26
- async def get_tinybird_local_config(config_obj: Dict[str, Any], build: bool = False) -> CLIConfig:
26
+ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
27
27
  """Craft a client config with a workspace name based on the path of the project files
28
28
 
29
29
  It uses the tokens from tinybird local
@@ -45,7 +45,7 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any], build: bool = Fa
45
45
  # Create a new workspace if path is provided. This is used to isolate the build in a different workspace.
46
46
  if path:
47
47
  user_client = config.get_client(host=TB_LOCAL_HOST, token=user_token)
48
- ws_name = get_build_workspace_name(path) if build else config.get("name") or config_obj.get("name")
48
+ ws_name = config.get("name") or config_obj.get("name") or get_build_workspace_name(path)
49
49
  if not ws_name:
50
50
  raise AuthNoTokenException()
51
51
 
@@ -198,7 +198,7 @@ class Shell:
198
198
  self.history = self.get_history()
199
199
  self.project = project
200
200
  self.tb_client = tb_client
201
- self.env = "cloud" if playground else "build"
201
+ self.env = "cloud" if playground else "local"
202
202
  self.prompt_message = "\ntb » "
203
203
  self.session: PromptSession = PromptSession(
204
204
  completer=DynamicCompleter(project),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev136
3
+ Version: 0.0.1.dev138
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird