def get_partition_id(self, key):
data = self._client.serialization_service.to_data(key)<EOL>count = self.get_partition_count()<EOL>if count <= <NUM_LIT:0>:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>return hash_to_index(data.get_partition_hash(), count)<EOL>
Returns the partition id for a Data key.

:param key: (object), the data key.
:return: (int), the partition id.