Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
parkervg committed Oct 18, 2024
2 parents f0ef10f + e858f89 commit 62cf265
Show file tree
Hide file tree
Showing 14 changed files with 299 additions and 229 deletions.
92 changes: 46 additions & 46 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,50 +42,50 @@ jobs:
run: |
python -m tox
- name: "Upload coverage data"
uses: actions/upload-artifact@v4
with:
name: covdata
path: .coverage.*

coverage:
name: Coverage
needs: tests
runs-on: ubuntu-latest
steps:
- name: "Check out the repo"
uses: "actions/checkout@v2"

- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.12"
# - name: "Upload coverage data"
# uses: actions/upload-artifact@v4
# with:
# name: covdata
# path: .coverage.*

- name: "Install dependencies"
run: |
python -m pip install tox tox-gh-actions
- name: "Download coverage data"
uses: actions/download-artifact@v4
with:
name: covdata

- name: "Combine"
run: |
python -m tox -e coverage
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
- name: "Make badge"
uses: schneegans/[email protected]
with:
# GIST_TOKEN is a GitHub personal access token with scope "gist".
auth: ${{ secrets.GIST_TOKEN }}
gistID: e24f1214fdff3ab086b829b5f01f85a8 # replace with your real Gist id.
filename: covbadge.json
label: Coverage
message: ${{ env.total }}%
minColorRange: 50
maxColorRange: 90
valColorRange: ${{ env.total }}
# coverage:
# name: Coverage
# needs: tests
# runs-on: ubuntu-latest
# steps:
# - name: "Check out the repo"
# uses: "actions/checkout@v2"
#
# - name: "Set up Python"
# uses: "actions/setup-python@v2"
# with:
# python-version: "3.12"
#
# - name: "Install dependencies"
# run: |
# python -m pip install tox tox-gh-actions
#
# - name: "Download coverage data"
# uses: actions/download-artifact@v4
# with:
# name: covdata
#
# - name: "Combine"
# run: |
# python -m tox -e coverage
# export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
# echo "total=$TOTAL" >> $GITHUB_ENV
# echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
#
# - name: "Make badge"
# uses: schneegans/[email protected]
# with:
# # GIST_TOKEN is a GitHub personal access token with scope "gist".
# auth: ${{ secrets.GIST_TOKEN }}
# gistID: e24f1214fdff3ab086b829b5f01f85a8 # replace with your real Gist id.
# filename: covbadge.json
# label: Coverage
# message: ${{ env.total }}%
# minColorRange: 50
# maxColorRange: 90
# valColorRange: ${{ env.total }}
6 changes: 6 additions & 0 deletions blendsql/db/_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ class Database(ABC):
db_url: Union[URL, str] = attrib()
lazy_tables: LazyTables = LazyTables()

def __str__(self):
return f"{self.__class__} @ {self.db_url}"

def __repr__(self):
return f"{self.__class__} @ {self.db_url}"

@abstractmethod
def _reset_connection(self) -> None:
"""Reset connection, so that temp tables are cleared."""
Expand Down
2 changes: 1 addition & 1 deletion blendsql/ingredients/builtin/join/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def make_predictions(lm, left_values, right_values):
messages.append(user(current_example.to_string()))
prompt = "".join([i["content"] for i in messages])
response = (
generate(model, messages=messages)
generate(model, messages_list=[messages])[0]
.removeprefix("```json")
.removesuffix("```")
)
Expand Down
2 changes: 1 addition & 1 deletion blendsql/ingredients/builtin/map/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def to_string(self, include_values: bool = True) -> str:

@attrs(kw_only=True)
class MapExample(_MapExample):
values: List[str] = attrib()
values: List[str] = attrib(default=None)


@attrs(kw_only=True)
Expand Down
Loading

0 comments on commit 62cf265

Please sign in to comment.