We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
TypeError: '<=' not supported between instances of 'int' and 'str' in /cognite/client/utils/_time.py", line 97, in ms_to_datetime in if not (MIN_TIMESTAMP_MS <= ms <= MAX_TIMESTAMP_MS)
**System information (please complete the following information):**
 - OS: macOS Sonoma v 14.1
 - Python Version: 3.11
 - SDK Version: 7.17.3

**Describe the bug**
In cognite/client/utils/_time.py
One needs to make sure that item[k] is integer. Otherwise In a `Type error` in the ms_to_datetime funciton
(see error at the end)
```
def _convert_and_isoformat_time_attrs_in_dict(item: dict) -> dict:
    for k in TIME_ATTRIBUTES.intersection(item):
        try:
            item[k] = ms_to_datetime(item[k]).isoformat(sep=" ", timespec="milliseconds")
        except ValueError:
            pass
    return item
```
**To Reproduce**
Runnable code reproducing the error.
```
"""
Test creating a data model in akerbp-sandbox
"""

# Authenticate with akerbp-sandbox
from cognite.client import CogniteClient, ClientConfig
from cognite.client.credentials import OAuthInteractive
from variables import (
    TENANT_ID,
    CDF_CLIENT_ID,
    CDF_CLIENT_NAME,
    CDF_BASE_URL,
)


# Create OAuth credentials
credentials = OAuthInteractive(
    authority_url=f"https://login.microsoftonline.com/{TENANT_ID}",
    client_id=CDF_CLIENT_ID,  # type: ignore
    scopes=[f"{CDF_BASE_URL}/.default"],
)

# Create client configurations
configurations = ClientConfig(
    client_name=CDF_CLIENT_NAME,  # type: ignore
    base_url=CDF_BASE_URL,
    project="akerbp-sandbox",  # type: ignore
    credentials=credentials,
)

# Initialize client
client = CogniteClient(configurations)




# Create a data model
from cognite.client.data_classes.data_modeling import DataModelApply
from cognite.client.data_classes.data_modeling import SpaceApply
from cognite.client.exceptions import CogniteAPIError

def apply_space(client: CogniteClient):
    space = client.data_modeling.spaces.apply(
        SpaceApply(
            space="test_sp_aad_cdf_mapping",
            name="test space for AAD CDF mapping",
        )
    )
    print(space)


def apply_data_model(client: CogniteClient):
    dm = client.data_modeling.data_models.apply(
        DataModelApply(
            space="test_sp_aad_cdf_mapping",
            external_id="test_dm_aad_cdf_mapping",
            version="v1",
            description="mapping between AAD members and CDF resources",
            name="test AAD CDF mapping",
        )
    )
    print(dm)


def apply_dml_to_data_model(client: CogniteClient):
    dm = client.data_modeling.graphql.apply_dml(
        id=("test_sp_aad_cdf_mapping", "test_dm_aad_cdf_mapping", "v1"),
        dml="""
type Group {
    id: String!
    name: String!
    members: [Member]
} 
type Member {
    id: String!
    name: String!
    type: String!
    groups: [Group]
}   
"""
)
    print("Done!")


def main() -> None:
    try:
        apply_data_model(client)
    except CogniteAPIError:
        apply_space(client)
        apply_data_model(client)
    
    apply_dml_to_data_model(client)


if __name__ == "__main__":
    main()
```

**Expected behavior**
```
{
    "space": "test_sp_aad_cdf_mapping",
    "external_id": "test_dm_aad_cdf_mapping",
    "version": "v1",
    "created_time": "2024-02-15T13:18:18.986Z",
    "last_updated_time": "2024-02-16T08:55:53.150Z"
}
```
**Screenshots**
```
Traceback (most recent call last):
  File "/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/src/test.py", line 144, in <module>
    main()
  File "/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/src/test.py", line 140, in main
    apply_dml_to_data_model(client)
  File "/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/src/test.py", line 130, in apply_dml_to_data_model
    print(dm)
  File "/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/.venv/lib/python3.11/site-packages/cognite/client/data_classes/_base.py", line 126, in __str__
    item = convert_and_isoformat_time_attrs(self.dump(camel_case=False))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/.venv/lib/python3.11/site-packages/cognite/client/utils/_time.py", line 209, in convert_and_isoformat_time_attrs
    return _convert_and_isoformat_time_attrs_in_dict(item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/.venv/lib/python3.11/site-packages/cognite/client/utils/_time.py", line 191, in _convert_and_isoformat_time_attrs_in_dict
    item[k] = ms_to_datetime(item[k]).isoformat(sep=" ", timespec="milliseconds")
              ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/.venv/lib/python3.11/site-packages/cognite/client/utils/_time.py", line 97, in ms_to_datetime
    if not (MIN_TIMESTAMP_MS <= ms <= MAX_TIMESTAMP_MS):
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'int' and 'str'
```



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `cognite/client/_version.py`
Content:
```
1 from __future__ import annotations
2 
3 __version__ = "7.20.0"
4 __api_subversion__ = "V20220125"
5
```

Path: `cognite/client/data_classes/data_modeling/graphql.py`
Content:
```
1 from __future__ import annotations
2 
3 from dataclasses import dataclass
4 from typing import TYPE_CHECKING, Any
5 
6 from typing_extensions import Self
7 
8 from cognite.client.data_classes._base import CogniteObject
9 from cognite.client.data_classes.data_modeling.ids import DataModelId
10 
11 if TYPE_CHECKING:
12     from cognite.client import CogniteClient
13 
14 
15 @dataclass
16 class DMLApplyResult(CogniteObject):
17     space: str
18     external_id: str
19     version: str
20     name: str | None
21     description: str | None
22     created_time: int
23     last_updated_time: int
24 
25     def as_id(self) -> DataModelId:
26         return DataModelId(
27             space=self.space,
28             external_id=self.external_id,
29             version=self.version,
30         )
31 
32     @classmethod
33     def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None = None) -> Self:
34         return cls(
35             space=resource["space"],
36             external_id=resource["externalId"],
37             version=resource["version"],
38             name=resource["name"],
39             description=resource["description"],
40             created_time=resource["createdTime"],
41             last_updated_time=resource["lastUpdatedTime"],
42         )
43 
44 
45 @dataclass
46 class GraphQlQueryResult(CogniteObject):
47     items: list[dict[str, Any]]
48 
49     @classmethod
50     def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None = None) -> Self:
51         return cls(resource["items"])
52
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/cognite/client/_version.py b/cognite/client/_version.py
--- a/cognite/client/_version.py
+++ b/cognite/client/_version.py
@@ -1,4 +1,4 @@
 from __future__ import annotations
 
-__version__ = "7.20.0"
+__version__ = "7.20.1"
 __api_subversion__ = "V20220125"
diff --git a/cognite/client/data_classes/data_modeling/graphql.py b/cognite/client/data_classes/data_modeling/graphql.py
--- a/cognite/client/data_classes/data_modeling/graphql.py
+++ b/cognite/client/data_classes/data_modeling/graphql.py
@@ -7,6 +7,7 @@
 
 from cognite.client.data_classes._base import CogniteObject
 from cognite.client.data_classes.data_modeling.ids import DataModelId
+from cognite.client.utils import _json
 
 if TYPE_CHECKING:
     from cognite.client import CogniteClient
@@ -19,8 +20,11 @@
     version: str
     name: str | None
     description: str | None
-    created_time: int
-    last_updated_time: int
+    created_time: str
+    last_updated_time: str
+
+    def __str__(self) -> str:
+        return _json.dumps(self.dump(camel_case=False), indent=4)
 
     def as_id(self) -> DataModelId:
         return DataModelId(

{"golden_diff": "diff --git a/cognite/client/_version.py b/cognite/client/_version.py\n--- a/cognite/client/_version.py\n+++ b/cognite/client/_version.py\n@@ -1,4 +1,4 @@\n from __future__ import annotations\n \n-__version__ = \"7.20.0\"\n+__version__ = \"7.20.1\"\n __api_subversion__ = \"V20220125\"\ndiff --git a/cognite/client/data_classes/data_modeling/graphql.py b/cognite/client/data_classes/data_modeling/graphql.py\n--- a/cognite/client/data_classes/data_modeling/graphql.py\n+++ b/cognite/client/data_classes/data_modeling/graphql.py\n@@ -7,6 +7,7 @@\n \n from cognite.client.data_classes._base import CogniteObject\n from cognite.client.data_classes.data_modeling.ids import DataModelId\n+from cognite.client.utils import _json\n \n if TYPE_CHECKING:\n     from cognite.client import CogniteClient\n@@ -19,8 +20,11 @@\n     version: str\n     name: str | None\n     description: str | None\n-    created_time: int\n-    last_updated_time: int\n+    created_time: str\n+    last_updated_time: str\n+\n+    def __str__(self) -> str:\n+        return _json.dumps(self.dump(camel_case=False), indent=4)\n \n     def as_id(self) -> DataModelId:\n         return DataModelId(\n", "issue": "TypeError: '<=' not supported between instances of 'int' and 'str' in /cognite/client/utils/_time.py\", line 97, in ms_to_datetime in if not (MIN_TIMESTAMP_MS <= ms <= MAX_TIMESTAMP_MS)\n**System information (please complete the following information):**\r\n - OS: macOS Sonoma v 14.1\r\n - Python Version: 3.11\r\n - SDK Version: 7.17.3\r\n\r\n**Describe the bug**\r\nIn cognite/client/utils/_time.py\r\nOne needs to make sure that item[k] is integer. Otherwise In a `Type error` in the ms_to_datetime funciton\r\n(see error at the end)\r\n```\r\ndef _convert_and_isoformat_time_attrs_in_dict(item: dict) -> dict:\r\n    for k in TIME_ATTRIBUTES.intersection(item):\r\n        try:\r\n            item[k] = ms_to_datetime(item[k]).isoformat(sep=\" \", timespec=\"milliseconds\")\r\n        except ValueError:\r\n            pass\r\n    return item\r\n```\r\n**To Reproduce**\r\nRunnable code reproducing the error.\r\n```\r\n\"\"\"\r\nTest creating a data model in akerbp-sandbox\r\n\"\"\"\r\n\r\n# Authenticate with akerbp-sandbox\r\nfrom cognite.client import CogniteClient, ClientConfig\r\nfrom cognite.client.credentials import OAuthInteractive\r\nfrom variables import (\r\n    TENANT_ID,\r\n    CDF_CLIENT_ID,\r\n    CDF_CLIENT_NAME,\r\n    CDF_BASE_URL,\r\n)\r\n\r\n\r\n# Create OAuth credentials\r\ncredentials = OAuthInteractive(\r\n    authority_url=f\"https://login.microsoftonline.com/{TENANT_ID}\",\r\n    client_id=CDF_CLIENT_ID,  # type: ignore\r\n    scopes=[f\"{CDF_BASE_URL}/.default\"],\r\n)\r\n\r\n# Create client configurations\r\nconfigurations = ClientConfig(\r\n    client_name=CDF_CLIENT_NAME,  # type: ignore\r\n    base_url=CDF_BASE_URL,\r\n    project=\"akerbp-sandbox\",  # type: ignore\r\n    credentials=credentials,\r\n)\r\n\r\n# Initialize client\r\nclient = CogniteClient(configurations)\r\n\r\n\r\n\r\n\r\n# Create a data model\r\nfrom cognite.client.data_classes.data_modeling import DataModelApply\r\nfrom cognite.client.data_classes.data_modeling import SpaceApply\r\nfrom cognite.client.exceptions import CogniteAPIError\r\n\r\ndef apply_space(client: CogniteClient):\r\n    space = client.data_modeling.spaces.apply(\r\n        SpaceApply(\r\n            space=\"test_sp_aad_cdf_mapping\",\r\n            name=\"test space for AAD CDF mapping\",\r\n        )\r\n    )\r\n    print(space)\r\n\r\n\r\ndef apply_data_model(client: CogniteClient):\r\n    dm = client.data_modeling.data_models.apply(\r\n        DataModelApply(\r\n            space=\"test_sp_aad_cdf_mapping\",\r\n            external_id=\"test_dm_aad_cdf_mapping\",\r\n            version=\"v1\",\r\n            description=\"mapping between AAD members and CDF resources\",\r\n            name=\"test AAD CDF mapping\",\r\n        )\r\n    )\r\n    print(dm)\r\n\r\n\r\ndef apply_dml_to_data_model(client: CogniteClient):\r\n    dm = client.data_modeling.graphql.apply_dml(\r\n        id=(\"test_sp_aad_cdf_mapping\", \"test_dm_aad_cdf_mapping\", \"v1\"),\r\n        dml=\"\"\"\r\ntype Group {\r\n    id: String!\r\n    name: String!\r\n    members: [Member]\r\n} \r\ntype Member {\r\n    id: String!\r\n    name: String!\r\n    type: String!\r\n    groups: [Group]\r\n}   \r\n\"\"\"\r\n)\r\n    print(\"Done!\")\r\n\r\n\r\ndef main() -> None:\r\n    try:\r\n        apply_data_model(client)\r\n    except CogniteAPIError:\r\n        apply_space(client)\r\n        apply_data_model(client)\r\n    \r\n    apply_dml_to_data_model(client)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n```\r\n\r\n**Expected behavior**\r\n```\r\n{\r\n    \"space\": \"test_sp_aad_cdf_mapping\",\r\n    \"external_id\": \"test_dm_aad_cdf_mapping\",\r\n    \"version\": \"v1\",\r\n    \"created_time\": \"2024-02-15T13:18:18.986Z\",\r\n    \"last_updated_time\": \"2024-02-16T08:55:53.150Z\"\r\n}\r\n```\r\n**Screenshots**\r\n```\r\nTraceback (most recent call last):\r\n  File \"/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/src/test.py\", line 144, in <module>\r\n    main()\r\n  File \"/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/src/test.py\", line 140, in main\r\n    apply_dml_to_data_model(client)\r\n  File \"/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/src/test.py\", line 130, in apply_dml_to_data_model\r\n    print(dm)\r\n  File \"/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/.venv/lib/python3.11/site-packages/cognite/client/data_classes/_base.py\", line 126, in __str__\r\n    item = convert_and_isoformat_time_attrs(self.dump(camel_case=False))\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/.venv/lib/python3.11/site-packages/cognite/client/utils/_time.py\", line 209, in convert_and_isoformat_time_attrs\r\n    return _convert_and_isoformat_time_attrs_in_dict(item)\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/.venv/lib/python3.11/site-packages/cognite/client/utils/_time.py\", line 191, in _convert_and_isoformat_time_attrs_in_dict\r\n    item[k] = ms_to_datetime(item[k]).isoformat(sep=\" \", timespec=\"milliseconds\")\r\n              ^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"/Users/andrian.gasper@cognitedata.com/Cognite/CDF-Aker-BP-Project/Extract-info-AAD/remote_repo/inso-dataops-incubator/integrating-aad-and-cdf-group-data/.venv/lib/python3.11/site-packages/cognite/client/utils/_time.py\", line 97, in ms_to_datetime\r\n    if not (MIN_TIMESTAMP_MS <= ms <= MAX_TIMESTAMP_MS):\r\n            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\nTypeError: '<=' not supported between instances of 'int' and 'str'\r\n```\r\n\r\n\n", "before_files": [{"content": "from __future__ import annotations\n\n__version__ = \"7.20.0\"\n__api_subversion__ = \"V20220125\"\n", "path": "cognite/client/_version.py"}, {"content": "from __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import TYPE_CHECKING, Any\n\nfrom typing_extensions import Self\n\nfrom cognite.client.data_classes._base import CogniteObject\nfrom cognite.client.data_classes.data_modeling.ids import DataModelId\n\nif TYPE_CHECKING:\n    from cognite.client import CogniteClient\n\n\n@dataclass\nclass DMLApplyResult(CogniteObject):\n    space: str\n    external_id: str\n    version: str\n    name: str | None\n    description: str | None\n    created_time: int\n    last_updated_time: int\n\n    def as_id(self) -> DataModelId:\n        return DataModelId(\n            space=self.space,\n            external_id=self.external_id,\n            version=self.version,\n        )\n\n    @classmethod\n    def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None = None) -> Self:\n        return cls(\n            space=resource[\"space\"],\n            external_id=resource[\"externalId\"],\n            version=resource[\"version\"],\n            name=resource[\"name\"],\n            description=resource[\"description\"],\n            created_time=resource[\"createdTime\"],\n            last_updated_time=resource[\"lastUpdatedTime\"],\n        )\n\n\n@dataclass\nclass GraphQlQueryResult(CogniteObject):\n    items: list[dict[str, Any]]\n\n    @classmethod\n    def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None = None) -> Self:\n        return cls(resource[\"items\"])\n", "path": "cognite/client/data_classes/data_modeling/graphql.py"}], "after_files": [{"content": "from __future__ import annotations\n\n__version__ = \"7.20.1\"\n__api_subversion__ = \"V20220125\"\n", "path": "cognite/client/_version.py"}, {"content": "from __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import TYPE_CHECKING, Any\n\nfrom typing_extensions import Self\n\nfrom cognite.client.data_classes._base import CogniteObject\nfrom cognite.client.data_classes.data_modeling.ids import DataModelId\nfrom cognite.client.utils import _json\n\nif TYPE_CHECKING:\n    from cognite.client import CogniteClient\n\n\n@dataclass\nclass DMLApplyResult(CogniteObject):\n    space: str\n    external_id: str\n    version: str\n    name: str | None\n    description: str | None\n    created_time: str\n    last_updated_time: str\n\n    def __str__(self) -> str:\n        return _json.dumps(self.dump(camel_case=False), indent=4)\n\n    def as_id(self) -> DataModelId:\n        return DataModelId(\n            space=self.space,\n            external_id=self.external_id,\n            version=self.version,\n        )\n\n    @classmethod\n    def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None = None) -> Self:\n        return cls(\n            space=resource[\"space\"],\n            external_id=resource[\"externalId\"],\n            version=resource[\"version\"],\n            name=resource[\"name\"],\n            description=resource[\"description\"],\n            created_time=resource[\"createdTime\"],\n            last_updated_time=resource[\"lastUpdatedTime\"],\n        )\n\n\n@dataclass\nclass GraphQlQueryResult(CogniteObject):\n    items: list[dict[str, Any]]\n\n    @classmethod\n    def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None = None) -> Self:\n        return cls(resource[\"items\"])\n", "path": "cognite/client/data_classes/data_modeling/graphql.py"}]}