Skip to content

Commit c1a9cd9

Browse files
authored
Merge pull request #3523 from corebit-nl/patch-1
Fallback on background callback function names if source cannot be found
2 parents cd8648b + ea1af01 commit c1a9cd9

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

CHANGELOG.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,26 @@ This project adheres to [Semantic Versioning](https://semver.org/).
44

55
## [UNRELEASED]
66

7+
## Added
8+
- [#3523](https://github.com/plotly/dash/pull/3523) Fall back to background callback function names if source cannot be found
9+
710
## Fixed
8-
- [#3690](https://github.com/plotly/dash/pull/3690) Fixes Input when min or max is set to None
11+
- [#3690](https://github.com/plotly/dash/pull/3690) Fixes Input when min or max is set to None
912

1013
## [4.1.0] - 2026-03-23
1114

1215
## Added
13-
- [#3637](https://github.com/plotly/dash/pull/3637) Added `debounce` prop to `Dropdown`.
16+
- [#3637](https://github.com/plotly/dash/pull/3637) Added `debounce` prop to `Dropdown`.
1417

1518
## Fixed
1619
- [#3629](https://github.com/plotly/dash/pull/3629) Fix date pickers not showing date when initially rendered in a hidden container.
17-
- [#3660][(](https://github.com/plotly/dash/pull/3660)) Allow same date to be selected for both start and end in DatePickerRange components
18-
- [#3600][(](https://github.com/plotly/dash/pull/3600)) DatePicker support for the Moment.js `Y` year token
19-
- [#3627][(](https://github.com/plotly/dash/pull/3627)) Make dropdowns searchable wheen focused, without requiring to open them first
20-
- [#3656][(](https://github.com/plotly/dash/pull/3656)) Improved dropdown performance for large collections of options
21-
- [#3643][(](https://github.com/plotly/dash/pull/3643)) Fix multiselect dropdown with components as labels
22-
- [#3609][(](https://github.com/plotly/dash/pull/3609)) Add backward compat alias for _Wildcard
23-
- [#3672][(](https://github.com/plotly/dash/pull/3672)) Improve browser performance when app contains a large number of pattern matching callback callbacks. Exposes an api endpoint to fetch the latest computeGraph call.
20+
- [#3660](https://github.com/plotly/dash/pull/3660) Allow same date to be selected for both start and end in DatePickerRange components
21+
- [#3600](https://github.com/plotly/dash/pull/3600) DatePicker support for the Moment.js `Y` year token
22+
- [#3627](https://github.com/plotly/dash/pull/3627) Make dropdowns searchable wheen focused, without requiring to open them first
23+
- [#3656](https://github.com/plotly/dash/pull/3656) Improved dropdown performance for large collections of options
24+
- [#3643](https://github.com/plotly/dash/pull/3643) Fix multiselect dropdown with components as labels
25+
- [#3609](https://github.com/plotly/dash/pull/3609) Add backward compat alias for _Wildcard
26+
- [#3672](https://github.com/plotly/dash/pull/3672) Improve browser performance when app contains a large number of pattern matching callback callbacks. Exposes an api endpoint to fetch the latest computeGraph call.
2427

2528

2629
## [4.0.0] - 2026-02-03
@@ -93,8 +96,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
9396

9497
## Added
9598

96-
- [#3568]((https://github.com/plotly/dash/pull/3568) Added `children` and `copied_children` props to `dcc.Clipboard` to customize the button contents before and after copying.
97-
- [#3534]((https://github.com/plotly/dash/pull/3534) Adds `playsInline` prop to `html.Video`. Based on [#2338]((https://github.com/plotly/dash/pull/2338)
99+
- [#3568](https://github.com/plotly/dash/pull/3568) Added `children` and `copied_children` props to `dcc.Clipboard` to customize the button contents before and after copying.
100+
- [#3534](https://github.com/plotly/dash/pull/3534) Adds `playsInline` prop to `html.Video`. Based on [#2338](https://github.com/plotly/dash/pull/2338)
98101
- [#3541](https://github.com/plotly/dash/pull/3541) Add `attributes` dictionary to be be formatted on script/link (_js_dist/_css_dist) tags of the index, allows for `type="module"` or `type="importmap"`. [#3538](https://github.com/plotly/dash/issues/3538)
99102
- [#3542](https://github.com/plotly/dash/pull/3542) Add hidden=True to dash pages callback.
100103
- [#3564](https://github.com/plotly/dash/pull/3564) Add new parameter `hide_all_callbacks` to `run()`. Closes [#3493](https://github.com/plotly/dash/issues/3493)
@@ -151,7 +154,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
151154
# [3.1.1] - 2025-06-29
152155

153156
## Fixed
154-
[#3351](https://github.com/plotly/dash/pull/3351) Fix multi-page app with `suppress_callback_exceptions=True`
157+
- [#3351](https://github.com/plotly/dash/pull/3351) Fix multi-page app with `suppress_callback_exceptions=True`
155158

156159
## [3.1.0] - 2025-06-27
157160

dash/background_callback/managers/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ def get_updated_props(self, key):
5656
raise NotImplementedError
5757

5858
def build_cache_key(self, fn, args, cache_args_to_ignore, triggered):
59-
fn_source = inspect.getsource(fn)
59+
try:
60+
fn_source = inspect.getsource(fn)
61+
fn_str = fn_source
62+
except OSError: # pylint: disable=too-broad-exception
63+
fn_str = getattr(fn, "__name__", "")
6064

6165
if not isinstance(cache_args_to_ignore, (list, tuple)):
6266
cache_args_to_ignore = [cache_args_to_ignore]
@@ -69,7 +73,7 @@ def build_cache_key(self, fn, args, cache_args_to_ignore, triggered):
6973
arg for i, arg in enumerate(args) if i not in cache_args_to_ignore
7074
]
7175

72-
hash_dict = dict(args=args, fn_source=fn_source, triggered=triggered)
76+
hash_dict = dict(args=args, fn_source=fn_str, triggered=triggered)
7377

7478
if self.cache_by is not None:
7579
# Caching enabled

0 commit comments

Comments
 (0)