docs: Add singleton tables documentation#137
Conversation
- Add section 2.5 "Singleton Tables (Empty Primary Keys)" to table-declaration.md - Update university tutorial with CurrentTerm singleton example - Remove deprecated `___` separator mention (only `---` is supported) Related to datajoint/datajoint-python#1341 Closes datajoint/datajoint-python#113 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add version-added admonitions to singleton table documentation: - table-declaration.md reference spec - university.ipynb tutorial (CurrentTerm example) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changes for PostgreSQL compatibility: - 04-queries.ipynb: Use CAST(correct AS INTEGER) for boolean aggregation - allen-ccf.ipynb: Use single quotes for LIKE pattern strings - languages.ipynb: Use single quotes for string comparisons - university.ipynb: Use CASE WHEN for conditional aggregation - sql-comparison.ipynb: Use single quotes for date string comparisons Backend detection: - json-type.ipynb: Skip on PostgreSQL (uses MySQL-specific JSON functions) - All notebooks: Add DJ_BACKEND environment variable handling Also adds PostgreSQL service to docker-compose.yaml. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All 21 documentation notebooks now support configuration via environment variables (DJ_HOST, DJ_USER, DJ_PASS, DJ_PORT) for CI/testing purposes. Also fixes: - Remove broken pytest.skip in json-type.ipynb - Revert CAST(correct AS INTEGER) to sum(correct) in 04-queries.ipynb (MySQL handles boolean sum natively) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changes: - Remove environment variable configuration from notebooks (DataJoint reads DJ_* env vars automatically) - Add conftest.py to configure DataJoint for pytest runs - Fix boolean aggregation in 04-queries.ipynb to work on both backends (use CASE WHEN instead of sum(boolean)) - Add PostgreSQL skip to json-type.ipynb (requires MySQL JSON functions) Test results: - MySQL: 21/21 passed - PostgreSQL: 20/20 passed, 1 skipped (json-type) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Simplified json-type.ipynb to focus on insert/fetch only - Removed complex JSON path queries (not portable across backends) - Added test output logs for MySQL and PostgreSQL runs Test results: - MySQL: 21/21 passed - PostgreSQL: 21/21 passed Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Re-run all notebooks against PostgreSQL with DJ_USE_TLS=false - Removes SSL connection warning from notebook outputs - Add scripts/execute-notebooks.sh for reproducible notebook execution Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change sum(correct) to sum(CASE WHEN correct THEN 1 ELSE 0 END) PostgreSQL doesn't support summing booleans directly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use single quotes for string literals in SQL expressions. PostgreSQL treats double quotes as identifiers. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change float32 to decimal for weight, duration, frame_rate - Decimal is more appropriate for manually entered values - Float remains for computed values and measurements Affected tutorials: - 01-first-pipeline: duration in Recording - 03-data-entry: duration in Session - 04-queries: weight in Subject, duration in Session - 06-object-storage: frame_rate in ImagingSession Also fixes: - PostgreSQL boolean aggregation (sum(correct) -> CASE WHEN) - PostgreSQL string quoting (double -> single quotes) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change reaction_time from float32 to decimal(3,2) in all tutorials - Add explicit decimal-to-float conversion in computation code - Decimal values from database need .astype(float) for numpy operations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Combines: - Singleton tables documentation - PostgreSQL compatibility fixes - Decimal types for human-entered fields - Secondary attributes terminology standardization - Notebook execution script Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The merge-base changed after approval.
The merge-base changed after approval.
- Add how-to/testing.md with pytest fixtures and CI/CD patterns - Add Testing section to navigation in mkdocs.yaml - Replace Russian language with Ukrainian in languages tutorial Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PostgreSQL interprets double quotes as identifier references, not string literals. Changed all examples to use the portable pattern: Table & "field = 'value'" instead of the MySQL-only pattern: Table & 'field = "value"' Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The merge-base changed after approval.
The merge-base changed after approval.
The merge-base changed after approval.
The merge-base changed after approval.
MilagrosMarin
left a comment
There was a problem hiding this comment.
Thanks @dimitri-yatsenko. It seems we are facing some issues with merging. I am going to try again after adding this comment.
The merge-base changed after approval.
MilagrosMarin
left a comment
There was a problem hiding this comment.
Comprehensive documentation update with singleton tables, PostgreSQL compatibility, and terminology improvements. All CI checks pass. Approved.
MilagrosMarin
left a comment
There was a problem hiding this comment.
Re-approving after branch update with latest main. CI checks pass. Comprehensive documentation update including singleton tables, PostgreSQL compatibility, decimal types for human-entered fields, and terminology standardization.
Summary
Combined documentation updates:
Changes
Singleton Tables
_singletonattribute)CurrentTermsingleton examplePostgreSQL Fixes
sum(correct)→sum(CASE WHEN correct THEN 1 ELSE 0 END)Type Improvements
float32todecimalfor manually entered values (weight, duration, frame_rate, reaction_time)floatfor computed values and measurementsDocumentation
heading.secondary_attributes)scripts/execute-notebooks.shfor reproducible notebook execution___separator mention (only---is supported)Related
Test Plan
🤖 Generated with Claude Code