Skip to content

Commit b60287f

Browse files
Merge master into pre/v2.1
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2 parents 2f0f2eb + d4faadc commit b60287f

File tree

10 files changed

+45
-92
lines changed

10 files changed

+45
-92
lines changed

.github/pr_labeler.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/docs.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/label_issues.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/label_prs.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/post_draft_release_published.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Post Draft Release Published
22

33
on:
4-
# Once draft release is released, trigger the docs release
54
release:
65
types:
76
## pre-release and stable release
@@ -11,8 +10,6 @@ on:
1110
run-name: Post ${{ github.event.release.name }}
1211

1312
jobs:
14-
call-publish-docs:
15-
uses: ./.github/workflows/docs.yaml
1613
pypi-release:
1714
permissions:
1815
# write permission is required to update version.py
@@ -60,7 +57,8 @@ jobs:
6057
# Update src in the <img> tag
6158
sed -i 's|\(<img id="commit-since-release-img"[^>]*src="\)[^"]*\(".*\)|\1'"$NEW_SRC"'\2|' README.md
6259
git add README.md
63-
git commit -m "Update README.md badge to ${{ github.event.release.tag_name }}"
60+
# Only commit if there are changes (handles re-runs gracefully)
61+
git diff --cached --quiet README.md || git commit -m "Update README.md badge to ${{ github.event.release.tag_name }}"
6462
- name: Set up Python ${{matrix.py_ver}}
6563
uses: actions/setup-python@v5
6664
with:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN ${CONDA_BIN} install --no-pin -qq -y -n base -c conda-forge \
1010
${CONDA_BIN} clean -qq -afy
1111
ENV PATH="$PATH:/home/mambauser/.local/bin"
1212

13-
COPY --chown=${HOST_UID:-1000}:mambauser ./pyproject.toml ./README.md ./LICENSE.txt /main/
13+
COPY --chown=${HOST_UID:-1000}:mambauser ./pyproject.toml ./README.md ./LICENSE /main/
1414
COPY --chown=${HOST_UID:-1000}:mambauser ./src/datajoint /main/src/datajoint
1515

1616
VOLUME /src

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dependencies = [
1010
"pymysql>=0.7.2",
1111
"deepdiff",
1212
"pyparsing",
13-
"ipython",
1413
"pandas",
1514
"tqdm",
1615
"networkx",
@@ -86,6 +85,9 @@ test = [
8685
"pytest",
8786
"pytest-cov",
8887
"requests",
88+
"faker",
89+
"matplotlib",
90+
"ipython",
8991
"graphviz",
9092
"testcontainers[mysql,minio,postgres]>=4.0",
9193
"polars>=0.20.0",
@@ -99,10 +101,14 @@ azure = ["adlfs>=2023.1.0"]
99101
postgres = ["psycopg2-binary>=2.9.0"]
100102
polars = ["polars>=0.20.0"]
101103
arrow = ["pyarrow>=14.0.0"]
104+
viz = ["matplotlib", "ipython"]
102105
test = [
103106
"pytest",
104107
"pytest-cov",
105108
"requests",
109+
"faker",
110+
"matplotlib",
111+
"ipython",
106112
"s3fs>=2023.1.0",
107113
"testcontainers[mysql,minio,postgres]>=4.0",
108114
"psycopg2-binary>=2.9.0",

src/datajoint/expression.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,12 @@ def fetch(
643643

644644
# Handle specific attributes requested
645645
if attrs:
646-
if as_dict or as_dict is None:
647-
# fetch('col1', 'col2', as_dict=True) or fetch('col1', 'col2')
646+
if as_dict is True:
647+
# fetch('col1', 'col2', as_dict=True) -> list of dicts
648648
return self.proj(*attrs).to_dicts(order_by=order_by, limit=limit, offset=offset, squeeze=squeeze)
649649
else:
650-
# fetch('col1', 'col2', as_dict=False) -> tuple of arrays
650+
# fetch('col1', 'col2') or fetch('col1', 'col2', as_dict=False) -> tuple of arrays
651+
# This matches DJ 1.x behavior where fetch('col') returns array(['alpha', 'beta'])
651652
return self.to_arrays(*attrs, order_by=order_by, limit=limit, offset=offset, squeeze=squeeze)
652653

653654
# Handle as_dict=True -> to_dicts()

src/datajoint/migrate.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
Codec system, particularly for upgrading blob columns to use
66
explicit `<blob>` type declarations.
77
8+
.. note::
9+
This module is provided temporarily to assist with migration from pre-2.0.
10+
It will be deprecated in DataJoint 2.1 and removed in 2.2.
11+
Complete your migrations while on DataJoint 2.0.
12+
813
Note on Terminology
914
-------------------
1015
This module uses "external storage" because that was the term in DataJoint 0.14.6.
@@ -16,9 +21,22 @@
1621

1722
import logging
1823
import re
24+
import warnings
1925
from typing import TYPE_CHECKING
2026

27+
from packaging.version import Version
28+
2129
from .errors import DataJointError
30+
from .version import __version__
31+
32+
# Show deprecation warning starting in 2.1
33+
if Version(__version__) >= Version("2.1"):
34+
warnings.warn(
35+
"datajoint.migrate is deprecated and will be removed in DataJoint 2.2. "
36+
"Complete your schema migrations before upgrading.",
37+
DeprecationWarning,
38+
stacklevel=2,
39+
)
2240

2341
if TYPE_CHECKING:
2442
from .schemas import Schema

tests/unit/test_fetch_compat.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,23 @@ def test_fetch_as_dict_true(self, mock_expression):
5353

5454
mock_expression.to_dicts.assert_called_once_with(order_by=None, limit=None, offset=None, squeeze=False)
5555

56-
def test_fetch_with_attrs_returns_dicts(self, mock_expression):
57-
"""fetch('col1', 'col2') should call proj().to_dicts()."""
56+
def test_fetch_with_attrs_returns_arrays(self, mock_expression):
57+
"""fetch('col1', 'col2') should call to_arrays() - matches DJ 1.x behavior."""
5858
with warnings.catch_warnings():
5959
warnings.simplefilter("ignore", DeprecationWarning)
6060
mock_expression.fetch("col1", "col2")
6161

62+
# DJ 1.x: fetch('col') returns array(['alpha', 'beta']), not list of dicts
63+
mock_expression.to_arrays.assert_called_once_with(
64+
"col1", "col2", order_by=None, limit=None, offset=None, squeeze=False
65+
)
66+
67+
def test_fetch_with_attrs_as_dict_true(self, mock_expression):
68+
"""fetch('col1', 'col2', as_dict=True) should call proj().to_dicts()."""
69+
with warnings.catch_warnings():
70+
warnings.simplefilter("ignore", DeprecationWarning)
71+
mock_expression.fetch("col1", "col2", as_dict=True)
72+
6273
mock_expression.proj.assert_called_once_with("col1", "col2")
6374
mock_expression.to_dicts.assert_called_once()
6475

0 commit comments

Comments
 (0)