class_docstr: Tests ensuring that when a dataset or samples in a dataset are modified
  all relevant objects are instantly in sync within the same process.
class_docstr_tok: ["Tests","ensuring","that","when","a","dataset","or","samples","in","a","dataset","are","modified","all","relevant","objects","are","instantly","in","sync","within","the","same","process","."]
docstr: Tests that when a field is added to the dataset schema via implicit
  adding on a sample, that change is reflected in the dataset.
docstr_tok: ["Tests","that","when","a","field","is","added","to","the","dataset","schema","via","implicit","adding","on","a","sample",",","that","change","is","reflected","in","the","dataset","."]
code: def test_sample_set_field(self):
      """Tests that when a field is added to the dataset schema via implicit
      adding on a sample, that change is reflected in the dataset.
      """
      dataset = fo.Dataset()
      sample = fo.Sample(filepath="test1.png")
      dataset.add_sample(sample)
  
      field_name = "field1"
      ftype = fo.IntField
      value = 51
  
      # field not in schema
      with self.assertRaises(KeyError):
          fields = dataset.get_field_schema()
          fields[field_name]
  
      # added to sample
      sample[field_name] = value
      fields = dataset.get_field_schema()
      self.assertIsInstance(fields[field_name], ftype)
  
file_path: fiftyone/tests/unittests/synchronization_tests.py
imports: import os
  import unittest
  import fiftyone
  from decorators import drop_datasets
label_desc: Use image node_id 5 for calling the SingleProcessSynchronizationTests obj's underlying member method code with example usage: obj.test_sample_set_field() without return types