Skip to content

DeprecationWarning from make_attrs in Python 3.12 #2327

Closed
@ricardoV94

Description

@ricardoV94

We're running the pymc CI in Python 3.12 (pymc-devs/pymc#7203) and seeing this warning: https://github.com/pymc-devs/pymc/actions/runs/8360787111/job/22887274333?pr=7203#step:7:4158

     def make_attrs(attrs=None, library=None):
        """Make standard attributes to attach to xarray datasets.
    
        Parameters
        ----------
        attrs : dict (optional)
            Additional attributes to add or overwrite
    
        Returns
        -------
        dict
            attrs
        """
        default_attrs = {
>           "created_at": datetime.datetime.utcnow().isoformat(),
            "arviz_version": __version__,
        }
E       DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions