No, you cannot do what you describe, as that does not make sense. You assign a variable g.data_version... so you have to assign something. What you described will look like a record:
g.data_version = # There is nothing else here
This is clearly invalid syntax. And indeed, there is no reason for this. You must either do:
if my_dict:
g.data_version = my_dict['dataVersion']
or
g.data_version = my_dict['dataVersion'] if my_dict else None
:
g.data_version = my_dict['dataVersion'] if my_dict else g.data_version
g.data_version, dict , , if.