Serialize config data into a string. Typically used to pass config via the ``DASK_INTERNAL_INHERIT_CONFIG`` environment variable. Parameters ---------- data: json-serializable object The data to serialize Returns ------- serialized_data: str The seriali
(data: Any)
| 845 | |
| 846 | |
| 847 | def serialize(data: Any) -> str: |
| 848 | """Serialize config data into a string. |
| 849 | |
| 850 | Typically used to pass config via the ``DASK_INTERNAL_INHERIT_CONFIG`` environment variable. |
| 851 | |
| 852 | Parameters |
| 853 | ---------- |
| 854 | data: json-serializable object |
| 855 | The data to serialize |
| 856 | |
| 857 | Returns |
| 858 | ------- |
| 859 | serialized_data: str |
| 860 | The serialized data as a string |
| 861 | |
| 862 | """ |
| 863 | return base64.urlsafe_b64encode(json.dumps(data).encode()).decode() |
| 864 | |
| 865 | |
| 866 | def deserialize(data: str) -> Any: |
no outgoing calls