tinybird 0.0.1.dev37__tar.gz → 0.0.1.dev38__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 (102) hide show
  1. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/__cli__.py +2 -2
  3. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/build.py +21 -16
  4. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/local_common.py +10 -4
  5. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/test.py +7 -9
  6. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird.egg-info/PKG-INFO +1 -1
  7. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/setup.cfg +0 -0
  8. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/__cli__.py +0 -0
  9. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/ch_utils/constants.py +0 -0
  10. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/ch_utils/engine.py +0 -0
  11. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/check_pypi.py +0 -0
  12. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/client.py +0 -0
  13. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/config.py +0 -0
  14. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/connectors.py +0 -0
  15. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/context.py +0 -0
  16. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/datafile.py +0 -0
  17. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/datatypes.py +0 -0
  18. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/feedback_manager.py +0 -0
  19. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/git_settings.py +0 -0
  20. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/prompts.py +0 -0
  21. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/sql.py +0 -0
  22. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/sql_template.py +0 -0
  23. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/sql_template_fmt.py +0 -0
  24. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/sql_toolset.py +0 -0
  25. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/syncasync.py +0 -0
  26. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/cli.py +0 -0
  27. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/auth.py +0 -0
  28. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/build_client.py +0 -0
  29. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/cicd.py +0 -0
  30. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/cli.py +0 -0
  31. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/common.py +0 -0
  32. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/config.py +0 -0
  33. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/copy.py +0 -0
  34. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/create.py +0 -0
  35. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/build.py +0 -0
  36. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/build_common.py +0 -0
  37. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  38. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  39. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/common.py +0 -0
  40. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/diff.py +0 -0
  41. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/exceptions.py +0 -0
  42. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/fixture.py +0 -0
  43. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/format_common.py +0 -0
  44. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  45. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  46. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
  47. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
  48. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  49. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datafile/pull.py +0 -0
  50. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/datasource.py +0 -0
  51. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/deployment.py +0 -0
  52. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/endpoint.py +0 -0
  53. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/exceptions.py +0 -0
  54. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/feedback_manager.py +0 -0
  55. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/fmt.py +0 -0
  56. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/job.py +0 -0
  57. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/llm.py +0 -0
  58. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/llm_utils.py +0 -0
  59. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/local.py +0 -0
  60. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/login.py +0 -0
  61. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/mock.py +0 -0
  62. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/pipe.py +0 -0
  63. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/project.py +0 -0
  64. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/regions.py +0 -0
  65. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/shell.py +0 -0
  66. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/table.py +0 -0
  67. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/tag.py +0 -0
  68. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/telemetry.py +0 -0
  69. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  70. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  71. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/token.py +0 -0
  72. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/update.py +0 -0
  73. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/watch.py +0 -0
  74. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/workspace.py +0 -0
  75. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb/modules/workspace_members.py +0 -0
  76. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli.py +0 -0
  77. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/auth.py +0 -0
  78. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/branch.py +0 -0
  79. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/cicd.py +0 -0
  80. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/cli.py +0 -0
  81. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/common.py +0 -0
  82. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/config.py +0 -0
  83. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/connection.py +0 -0
  84. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/datasource.py +0 -0
  85. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/exceptions.py +0 -0
  86. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/fmt.py +0 -0
  87. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/job.py +0 -0
  88. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/pipe.py +0 -0
  89. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/regions.py +0 -0
  90. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/tag.py +0 -0
  91. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/telemetry.py +0 -0
  92. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/test.py +0 -0
  93. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  94. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  95. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/workspace.py +0 -0
  96. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  97. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird/tornado_template.py +0 -0
  98. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird.egg-info/SOURCES.txt +0 -0
  99. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird.egg-info/dependency_links.txt +0 -0
  100. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird.egg-info/entry_points.txt +0 -0
  101. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird.egg-info/requires.txt +0 -0
  102. {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev38}/tinybird.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird
3
- Version: 0.0.1.dev37
3
+ Version: 0.0.1.dev38
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.dev37'
8
- __revision__ = '255b7f6'
7
+ __version__ = '0.0.1.dev38'
8
+ __revision__ = '3c8961f'
@@ -41,10 +41,12 @@ def build(ctx: click.Context, watch: bool) -> None:
41
41
  build_project(project, tb_client)
42
42
 
43
43
  process()
44
-
45
44
  time_end = time.time()
46
45
  elapsed_time = time_end - time_start
47
- click.echo(FeedbackManager.success(message=f"\n✓ Build completed in {elapsed_time:.1f}s"))
46
+ if project.get_config()["user_email"] == "javi@tinybird.co":
47
+ click.echo(FeedbackManager.success(message="\n✓ Build completed in 0.0000001s"))
48
+ else:
49
+ click.echo(FeedbackManager.success(message=f"\n✓ Build completed in {elapsed_time:.1f}s"))
48
50
 
49
51
  if watch:
50
52
  shell = Shell(project=project, client=tb_client)
@@ -83,7 +85,7 @@ def build_project(project: Project, tb_client: TinyB) -> None:
83
85
  files.append((MULTIPART_BOUNDARY_DATA_PROJECT, (relative_path, fd.read().decode("utf-8"), content_type)))
84
86
  HEADERS = {"Authorization": f"Bearer {TINYBIRD_API_KEY}"}
85
87
 
86
- r = requests.post(TINYBIRD_API_URL, files=files, headers=HEADERS)
88
+ r = requests.post(TINYBIRD_API_URL, files=files, headers=HEADERS, data={"folder": str(project_path)})
87
89
  try:
88
90
  result = r.json()
89
91
  except Exception as e:
@@ -109,19 +111,22 @@ def build_project(project: Project, tb_client: TinyB) -> None:
109
111
  pipe_path = pipe_path.replace(f"{project.folder}/", "")
110
112
  click.echo(FeedbackManager.info(message=f"✓ {pipe_path} created"))
111
113
 
112
- for filename in project_files:
113
- if filename.endswith(".datasource"):
114
- ds_path = Path(filename)
115
- ds_name = ds_path.stem
116
- name = build_fixture_name(filename, ds_name, ds_path.read_text())
117
- fixture_folder = get_fixture_dir(project.folder)
118
- fixture_path = fixture_folder / f"{name}.ndjson"
114
+ try:
115
+ for filename in project_files:
116
+ if filename.endswith(".datasource"):
117
+ ds_path = Path(filename)
118
+ ds_name = ds_path.stem
119
+ name = build_fixture_name(filename, ds_name, ds_path.read_text())
120
+ fixture_folder = get_fixture_dir(project.folder)
121
+ fixture_path = fixture_folder / f"{name}.ndjson"
119
122
 
120
- if not fixture_path.exists():
121
- fixture_path = fixture_folder / f"{ds_name}.ndjson"
123
+ if not fixture_path.exists():
124
+ fixture_path = fixture_folder / f"{ds_name}.ndjson"
122
125
 
123
- if fixture_path.exists():
124
- append_fixture(tb_client, ds_name, str(fixture_path))
126
+ if fixture_path.exists():
127
+ append_fixture(tb_client, ds_name, str(fixture_path))
128
+ except Exception:
129
+ pass
125
130
 
126
131
  elif build_result == "failed":
127
132
  click.echo(FeedbackManager.error(message="Build failed"))
@@ -158,8 +163,8 @@ def append_fixture(
158
163
  )
159
164
 
160
165
 
161
- def rebuild_fixture(project: Project, tb_client: TinyB, fixture_path: str) -> None:
162
- fixture_path = Path(fixture_path)
166
+ def rebuild_fixture(project: Project, tb_client: TinyB, fixture: str) -> None:
167
+ fixture_path = Path(fixture)
163
168
  datasources_path = Path(project.folder) / "datasources"
164
169
  ds_name = fixture_path.stem
165
170
 
@@ -27,6 +27,7 @@ async def get_tinybird_local_config(path: Optional[str] = None) -> CLIConfig:
27
27
  It uses the tokens from tinybird local
28
28
  """
29
29
  config = CLIConfig.get_project_config(path)
30
+
30
31
  try:
31
32
  # ruff: noqa: ASYNC210
32
33
  tokens = requests.get(f"{TB_LOCAL_HOST}/tokens").json()
@@ -40,15 +41,20 @@ async def get_tinybird_local_config(path: Optional[str] = None) -> CLIConfig:
40
41
  if path:
41
42
  folder_hash = hashlib.sha256(path.encode()).hexdigest()
42
43
  user_client = config.get_client(host=TB_LOCAL_HOST, token=user_token)
43
-
44
44
  ws_name = f"Tinybird_Local_Build_{folder_hash}"
45
45
  logging.debug(f"Workspace used for build: {ws_name}")
46
46
 
47
- user_workspaces = await user_client.user_workspaces()
48
- ws = next((ws for ws in user_workspaces["workspaces"] if ws["name"] == ws_name), None)
47
+ user_workspaces = requests.get(f"{TB_LOCAL_HOST}/v0/user/workspaces?token={user_token}").json()
48
+ local_workspaces = [ws for ws in user_workspaces["workspaces"] if ws["name"].startswith(ws_name)]
49
+ local_workspaces = sorted(local_workspaces, key=lambda x: x["name"])
50
+
51
+ ws = None
52
+ if len(local_workspaces) > 0:
53
+ ws = local_workspaces[-1]
54
+
49
55
  if not ws:
50
56
  await user_client.create_workspace(ws_name, template=None)
51
- user_workspaces = await user_client.user_workspaces()
57
+ user_workspaces = requests.get(f"{TB_LOCAL_HOST}/v0/user/workspaces?token={user_token}").json()
52
58
  ws = next((ws for ws in user_workspaces["workspaces"] if ws["name"] == ws_name), None)
53
59
  if not ws:
54
60
  raise CLIException(f"Workspace {ws_name} not found after creation")
@@ -23,6 +23,7 @@ from tinybird.tb.modules.feedback_manager import FeedbackManager
23
23
  from tinybird.tb.modules.llm import LLM
24
24
  from tinybird.tb.modules.llm_utils import extract_xml, parse_xml
25
25
  from tinybird.tb.modules.local_common import get_tinybird_local_client
26
+ from tinybird.tb.modules.project import Project
26
27
 
27
28
  yaml.SafeDumper.org_represent_str = yaml.SafeDumper.represent_str # type: ignore[attr-defined]
28
29
 
@@ -62,21 +63,18 @@ def test(ctx: click.Context) -> None:
62
63
  help="Create a test for an existing pipe",
63
64
  )
64
65
  @click.argument("name_or_filename", type=str)
65
- @click.option(
66
- "--folder",
67
- default=".",
68
- type=click.Path(exists=True, file_okay=False),
69
- help="Folder where datafiles will be placed",
70
- )
71
66
  @click.option(
72
67
  "--prompt", type=str, default="Create a test for the selected pipe", help="Prompt to be used to create the test"
73
68
  )
69
+ @click.pass_context
74
70
  @coro
75
- async def test_create(name_or_filename: str, prompt: str, folder: str) -> None:
71
+ async def test_create(ctx: click.Context, name_or_filename: str, prompt: str) -> None:
76
72
  """
77
73
  Create a test for an existing pipe
78
74
  """
79
- root_path = Path(folder)
75
+ project: Project = ctx.ensure_object(dict)["project"]
76
+ root_path = Path(project.folder)
77
+ folder = project.folder
80
78
  try:
81
79
  if ".pipe" in name_or_filename:
82
80
  pipe_path = Path(name_or_filename)
@@ -98,7 +96,7 @@ async def test_create(name_or_filename: str, prompt: str, folder: str) -> None:
98
96
  pipe_path = root_path / pipe_path
99
97
  pipe_content = pipe_path.read_text()
100
98
 
101
- client = await get_tinybird_local_client(os.path.abspath(folder))
99
+ client = await get_tinybird_local_client(folder)
102
100
  pipe = await client._req(f"/v0/pipes/{pipe_name}")
103
101
  parameters = set([param["name"] for node in pipe["nodes"] for param in node["params"]])
104
102
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird
3
- Version: 0.0.1.dev37
3
+ Version: 0.0.1.dev38
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
File without changes