Skip to content

Commit bc12b11

Browse files
use regex to identify part tables in utils.get_master
1 parent 4a2e1af commit bc12b11

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

LNX-docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232
interval: 1s
3333
fakeservices.datajoint.io:
3434
<<: *net
35-
image: datajoint/nginx:v0.0.17
35+
image: datajoint/nginx:v0.0.18
3636
environment:
3737
- ADD_db_TYPE=DATABASE
3838
- ADD_db_ENDPOINT=db:3306

datajoint/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def get_master(full_table_name):
4444
`ephys`.`session` -- master
4545
`ephys`.`session__recording` -- part
4646
"""
47-
master, *part = full_table_name.split('__')
48-
return master + '`' if part else ""
47+
match = re.match(r'(?P<master>`\w+`.`\w+)__(?P<part>\w+)`', full_table_name)
48+
return match['master'] + '`' if match else ''
4949

5050

5151
def to_camel_case(s):

0 commit comments

Comments
 (0)