Skip to content

Commit

Permalink
📝 bump version, change streamlit demo link to v2 app, remove ttl on c…
Browse files Browse the repository at this point in the history
…ompile
  • Loading branch information
z3z1ma committed Mar 30, 2023
1 parent e30180a commit d4e12f4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 37 deletions.
1 change: 1 addition & 0 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[runner]
magicEnabled = false
fileWatcherType = "none"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
![Downloads](https://pepy.tech/badge/dbt-osmosis)
![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-green.svg)
![black](https://img.shields.io/badge/code%20style-black-000000.svg)
[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://z3z1ma-dbt-osmosis-srcdbt-osmosisapp-4y67qs.streamlitapp.com/)
[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://z3z1ma-dbt-osmosis-srcdbt-osmosisapp-v2-i0ico9.streamlit.app/)


[![Scc Count Badge](https://sloc.xyz/github/z3z1ma/dbt-osmosis/)](https://github.com/z3z1ma/dbt-osmosis/)
Expand Down Expand Up @@ -84,7 +84,7 @@ I also expect there is some untapped value in the workbench that is only pending
Demo the workbench 👇
[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://z3z1ma-dbt-osmosis-srcdbt-osmosisapp-4y67qs.streamlitapp.com/)
[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://z3z1ma-dbt-osmosis-srcdbt-osmosisapp-v2-i0ico9.streamlit.app/)
```sh
Expand Down
21 changes: 12 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dbt-osmosis"
version = "0.11.12"
version = "0.11.13"
description = "A dbt server and suite of optional developer tools to make developing with dbt delightful."
authors = ["z3z1ma <[email protected]>"]
license = "Apache 2.0"
Expand All @@ -21,7 +21,7 @@ documentation = "https://github.com/z3z1ma/dbt-osmosis"
repository = "https://github.com/z3z1ma/dbt-osmosis"

[tool.poetry.dependencies]
python = ">=3.8,<3.11"
python = ">=3.8,<3.9.7 || >3.9.7,<3.11"
click = ">7"
dbt-core = ">=1"
"ruamel.yaml" = ">=0.17"
Expand All @@ -30,7 +30,7 @@ pydantic = "<2"
GitPython = ">3,<4"
orjson = ">3,<4"
# Streamlit Workbench Dependencies
streamlit = { version = ">=1.0.0", optional = true }
streamlit = { version = "1.20.0", optional = true }
streamlit-ace = { version = ">=0.1.0", optional = true }
ydata-profiling = { version = ">=3.6.0", optional = true }
feedparser = { version = "^6.0.10", optional = true }
Expand Down
23 changes: 0 additions & 23 deletions src/dbt_osmosis/app_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import decimal
import os
import sys
import time
from collections import OrderedDict
from datetime import datetime, date
from textwrap import dedent
Expand Down Expand Up @@ -195,28 +194,6 @@ def sidebar(ctx: DbtProject) -> None:
)


def ttl_cache(wait):
"""Debounce a function call."""

def decorator(func):
last_called = time.time()
cached_result = None

def cached(*args, **kwargs):
nonlocal last_called, cached_result
elapsed = time.time() - last_called
if elapsed < wait and cached_result is not None:
return cached_result
cached_result = func(*args, **kwargs)
last_called = time.time()
return cached_result

return cached

return decorator


@ttl_cache(3.0)
def compile(ctx: DbtProject, sql: str) -> str:
"""Compile SQL using dbt context."""
try:
Expand Down

0 comments on commit d4e12f4

Please sign in to comment.