Title: Bug: reserve_jobs=True fails when dj.config.jobs.add_job_metadata = True and dj.config.jobs.keep_completed = True · Issue #1379 · datajoint/datajoint-python · GitHub
Open Graph Title: Bug: reserve_jobs=True fails when dj.config.jobs.add_job_metadata = True and dj.config.jobs.keep_completed = True · Issue #1379 · datajoint/datajoint-python
X Title: Bug: reserve_jobs=True fails when dj.config.jobs.add_job_metadata = True and dj.config.jobs.keep_completed = True · Issue #1379 · datajoint/datajoint-python
Description: Bug Report Description When testing the job metadata functionality i encountered following problem: When setting dj.config.jobs.add_job_metadata = True dj.config.jobs.keep_completed = True i cant run populate with reserve_jobs=True. Repr...
Open Graph Description: Bug Report Description When testing the job metadata functionality i encountered following problem: When setting dj.config.jobs.add_job_metadata = True dj.config.jobs.keep_completed = True i cant r...
X Description: Bug Report Description When testing the job metadata functionality i encountered following problem: When setting dj.config.jobs.add_job_metadata = True dj.config.jobs.keep_completed = True i cant r...
Opengraph URL: https://github.com/datajoint/datajoint-python/issues/1379
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: reserve_jobs=True fails when dj.config.jobs.add_job_metadata = True and dj.config.jobs.keep_completed = True","articleBody":"## Bug Report\n\n### Description\nWhen testing the job metadata functionality i encountered following problem:\nWhen setting\n```\ndj.config.jobs.add_job_metadata = True\ndj.config.jobs.keep_completed = True\n```\ni cant run populate with reserve_jobs=True.\n\n### Reproducibility\n```\nimport datajoint as dj\ndj.config.jobs.add_job_metadata = True\ndj.config.jobs.keep_completed = True\ndj.conn() # using datajoint.json\nschema = dj.Schema(\"TEST_\")\n\n@schema\nclass Numbers(dj.Lookup):\n definition = \"\"\"\n number: int64\n \"\"\"\n contents = [(0,), (1,), (2,), (4,), (8,)]\n\n@schema\nclass NumbersSquared(dj.Computed):\n definition = \"\"\"\n -\u003e Numbers\n ---\n squared: int64\n \"\"\"\n\n def make(self, key):\n self.insert1({**key, \"squared\": key[\"number\"] ** 2})\n\nNumbersSquared.populate(reserve_jobs=True)\n```\nFails with: \n```\n---------------------------------------------------------------------------\nDataJointError Traceback (most recent call last)\nCell In[2], line 1\n----\u003e 1 NumbersSquared.populate(reserve_jobs=True)\n\nFile ~/datajoint-python/src/datajoint/autopopulate.py:366, in AutoPopulate.populate(self, suppress_errors, return_exception_objects, reserve_jobs, max_calls, display_progress, processes, make_kwargs, priority, refresh, *restrictions)\n 363 raise DataJointError(\"Populate cannot be called during a transaction.\")\n 365 if reserve_jobs:\n--\u003e 366 return self._populate_distributed(\n 367 *restrictions,\n 368 suppress_errors=suppress_errors,\n 369 return_exception_objects=return_exception_objects,\n 370 max_calls=max_calls,\n 371 display_progress=display_progress,\n 372 processes=processes,\n 373 make_kwargs=make_kwargs,\n 374 priority=priority,\n 375 refresh=refresh,\n 376 )\n 377 else:\n 378 return self._populate_direct(\n 379 *restrictions,\n 380 suppress_errors=suppress_errors,\n (...) 385 make_kwargs=make_kwargs,\n 386 )\n\nFile ~/datajoint-python/src/datajoint/autopopulate.py:490, in AutoPopulate._populate_distributed(self, suppress_errors, return_exception_objects, max_calls, display_progress, processes, make_kwargs, priority, refresh, *restrictions)\n 486 refresh = config.jobs.auto_refresh\n 487 if refresh:\n 488 # Use delay=-1 to ensure jobs are immediately schedulable\n 489 # (avoids race condition with scheduled_time \u003c= CURRENT_TIMESTAMP(3) check)\n--\u003e 490 self.jobs.refresh(*restrictions, priority=priority, delay=-1)\n 492 # Fetch pending jobs ordered by priority (use CURRENT_TIMESTAMP(3) for datetime(3) precision)\n 493 pending_query = self.jobs.pending \u0026 \"scheduled_time \u003c= CURRENT_TIMESTAMP(3)\"\n\nFile ~/datajoint-python/src/datajoint/jobs.py:398, in Job.refresh(self, delay, priority, stale_timeout, orphan_timeout, *restrictions)\n 394 # 2. Re-pend success jobs if keep_completed=True\n 395 if config.jobs.keep_completed:\n 396 # Success jobs whose keys are in key_source but not in target\n 397 # Disable semantic_check for Job table operations\n--\u003e 398 success_to_repend = self.completed.restrict(key_source, semantic_check=False) - self._target\n 399 repend_keys = success_to_repend.keys()\n 400 for key in repend_keys:\n\nFile ~/datajoint-python/src/datajoint/expression.py:282, in QueryExpression.__sub__(self, restriction)\n 276 def __sub__(self, restriction):\n 277 \"\"\"\n 278 Inverted restriction e.g. ``q1 - q2``.\n 279 :return: a restricted copy of the input argument\n 280 See QueryExpression.restrict for more detail.\n 281 \"\"\"\n--\u003e 282 return self.restrict(Not(restriction))\n\nFile ~/datajoint-python/src/datajoint/expression.py:234, in QueryExpression.restrict(self, restriction, semantic_check)\n 232 result._top = restriction\n 233 return result\n--\u003e 234 new_condition = make_condition(self, restriction, attributes, semantic_check=semantic_check)\n 235 if new_condition is True:\n 236 return self # restriction has no effect, return the same object\n\nFile ~/datajoint-python/src/datajoint/condition.py:403, in make_condition(query_expression, condition, columns, semantic_check)\n 401 # restrict by another expression\n 402 if isinstance(condition, QueryExpression):\n--\u003e 403 assert_join_compatibility(query_expression, condition, semantic_check=semantic_check)\n 404 # Match on all non-hidden namesakes (hidden attributes excluded)\n 405 common_attributes = [q for q in condition.heading.names if q in query_expression.heading.names]\n\nFile ~/datajoint-python/src/datajoint/condition.py:256, in assert_join_compatibility(expr1, expr2, semantic_check)\n 254 # Semantic match requires both lineages to be non-None and equal\n 255 if lineage1 is None or lineage2 is None or lineage1 != lineage2:\n--\u003e 256 raise DataJointError(\n 257 f\"Cannot join on attribute `{name}`: \"\n 258 f\"different lineages ({lineage1} vs {lineage2}). \"\n 259 f\"Use .proj() to rename one of the attributes.\"\n 260 )\n\nDataJointError: Cannot join on attribute `number`: different lineages (TEST_.~~numbers_squared.number vs TEST_.#numbers.number). Use .proj() to rename one of the attributes.\n```\n\nUbuntu 24.04, python 3.12.11\nMySQL - remotely accessed myslq-latest docker (MySQL Server 9.6.0-1.el9)\nDataJoint Version : DataJoint 2.0.0a27\n\n\n","author":{"url":"https://github.com/arturoptophys","@type":"Person","name":"arturoptophys"},"datePublished":"2026-02-05T12:34:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1379/datajoint-python/issues/1379"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:df419e5d-cd85-5b30-6b37-ea5482991753 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC78:315724:4C67ED:664659:6A4DA4FB |
| html-safe-nonce | fab0825c6d6d6b0ee5be4a946e0ca53e19a2a32c06ed23d7cfc5f777e557c646 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzc4OjMxNTcyNDo0QzY3RUQ6NjY0NjU5OjZBNERBNEZCIiwidmlzaXRvcl9pZCI6Ijg5NjM4OTg5MDM3Nzk3MTQyOTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bd524299ec9024a5a532b542e843fb4752fa351259fa716d1e1fc607a39a5de6 |
| hovercard-subject-tag | issue:3901356664 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/datajoint/datajoint-python/1379/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8e20b1004457ed27cf5513d966aafa8dac5cd4b0c0ce7311e9da1414fe1f9b4a/datajoint/datajoint-python/issues/1379 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8e20b1004457ed27cf5513d966aafa8dac5cd4b0c0ce7311e9da1414fe1f9b4a/datajoint/datajoint-python/issues/1379 |
| og:image:alt | Bug Report Description When testing the job metadata functionality i encountered following problem: When setting dj.config.jobs.add_job_metadata = True dj.config.jobs.keep_completed = True i cant r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | arturoptophys |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/datajoint/datajoint-python git https://github.com/datajoint/datajoint-python.git |
| octolytics-dimension-user_id | 2375501 |
| octolytics-dimension-user_login | datajoint |
| octolytics-dimension-repository_id | 5866704 |
| octolytics-dimension-repository_nwo | datajoint/datajoint-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5866704 |
| octolytics-dimension-repository_network_root_nwo | datajoint/datajoint-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7f13faa65cccc9b729d674da83335d5dcfdfd193 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width