code: def test_carto_layer_json():
      layer = pdk.Layer(
          "CartoLayer",
          data="carto-demo-data.demo_tables.wrong_table",
          type_=MapType.TABLE,
          connection=CartoConnection.CARTO_DW,
          credentials={},
      )
      json_input = json.loads(layer.to_json())
  
      assert json_input["@@type"] == "CartoLayer"
      assert (
          json_input["data"]
          == "carto-demo-data.demo_tables.wrong_table"
      )
      assert json_input["type"] == "table"
      assert json_input["connection"] == "carto_dw"
      assert json_input["credentials"] == {}
      # Default attributes
      assert json_input["clientId"] == "pydeck-carto"
      assert json_input["onDataError"] == {"@@function": "notifyError"}
  
file_path: deck.gl/bindings/pydeck-carto/tests/test_layer.py
imports: import json
  import pydeck
  from carto_auth import CartoAuth
  from pydeck_carto import register_carto_layer, get_layer_credentials
  from pydeck_carto.layer import MapType, CartoConnection
label_desc: Use image node_id 3 for calling a global function with example usage: test_carto_layer_json() without return types