Skip to content

Commit d52f072

Browse files
Merge branch 'cascade-delete' of https://github.com/dimitri-yatsenko/datajoint-python into cascade-delete
2 parents ed7c624 + 052a36b commit d52f072

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Coverage Status](https://coveralls.io/repos/datajoint/datajoint-python/badge.svg?branch=master&service=github)](https://coveralls.io/github/datajoint/datajoint-python?branch=master)
44
[![PyPI version](https://badge.fury.io/py/datajoint.svg)](http://badge.fury.io/py/datajoint)
55
[![Requirements Status](https://requires.io/github/datajoint/datajoint-python/requirements.svg?branch=master)](https://requires.io/github/datajoint/datajoint-python/requirements/?branch=master)
6-
[![Join the chat at https://gitter.im/datajoint/datajoint-python](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/datajoint/datajoint-python?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6+
[![Slack](https://img.shields.io/badge/slack-chat-green.svg)](https://datajoint.slack.com/)
77

88
# Welcome to DataJoint for Python!
99
DataJoint for Python is a framework for scientific workflow management based on relational principles. DataJoint is built on the foundation of the relational data model and prescribes a consistent method for organizing, populating, computing, and querying data.

docs-parts/computation/06-distributed-computing_jobs_by_key.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ This can be done by using `dj.key_hash` to convert the key as follows:
33

44
.. code-block:: python
55
6-
In [4]: schema.jobs & {'key_hash' : dj.key_hash({'id': 2})}
7-
Out[4]:
6+
In [4]: jk = {'table_name': JobResults.table_name, 'key_hash' : dj.key_hash({'id': 2})}
7+
In [5]: schema.jobs & jk
8+
Out[5]:
89
*table_name *key_hash status key error_message error_stac user host pid connection_id timestamp
910
+------------+ +------------+ +--------+ +--------+ +------------+ +--------+ +------------+ +-------+ +--------+ +------------+ +------------+
1011
__job_results c81e728d9d4c2f error =BLOB= KeyboardInterr =BLOB= datajoint@localhost localhost 15571 59 2017-09-04 14:
1112
(Total: 1)
1213
13-
In [5]: (schema.jobs & {'key_hash' : dj.key_hash({'id': 2})}).delete()
14+
In [6]: (schema.jobs & jk).delete()
1415
15-
In [6]: schema.jobs & {'key_hash' : dj.key_hash({'id': 2})}
16-
Out[6]:
16+
In [7]: schema.jobs & jk
17+
Out[7]:
1718
*table_name *key_hash status key error_message error_stac user host pid connection_id timestamp
1819
+------------+ +----------+ +--------+ +--------+ +------------+ +--------+ +------+ +------+ +-----+ +------------+ +-----------+
1920

tests/schema.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,22 @@ class ThingC(dj.Manual):
345345
---
346346
-> [unique, nullable] ThingB
347347
"""
348+
349+
350+
@schema
351+
class Parent(dj.Manual):
352+
definition = """
353+
parent_id: int
354+
---
355+
name: varchar(30)
356+
"""
357+
358+
359+
@schema
360+
class Child(dj.Manual):
361+
definition = """
362+
-> Parent
363+
child_id: int
364+
---
365+
name: varchar(30)
366+
"""

tests/test_fetch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,6 @@ def test_fetch_format(self):
247247

248248
# revert configuration of fetch format
249249
dj.config['fetch_format'] = 'array'
250+
251+
def test_same_secondary_attribute(self):
252+
print(schema.Child * schema.Parent().proj())

0 commit comments

Comments
 (0)