code: def bolt_graph_to_edges_dataframe(graph):
      is_neptune = False
  
      for relationship in graph.relationships:
          # neptune results not returing element_id, so use id instead
          is_neptune = not hasattr(relationship, "element_id")
          break
  
      if is_neptune:
          map_dict_df = pd.DataFrame(
              [
                  {
                      relationship_id_key: relationship.id,  # noqa: E241
                      relationship_type_key: relationship.type,  # noqa: E241
                      start_node_id_key: relationship.start_node.id,  # noqa: E241
                      end_node_id_key: relationship.end_node.id,  # noqa: E241
                  }
                  for relationship in graph.relationships
              ]
          )
      else:
          map_dict_df = pd.DataFrame(
              [
                  {
                      relationship_id_key: relationship.element_id,  # noqa: E241
                      relationship_type_key: relationship.type,  # noqa: E241
                      start_node_id_key: relationship.start_node.element_id,  # noqa: E241
                      end_node_id_key: relationship.end_node.element_id,  # noqa: E241
                  }
                  for relationship in graph.relationships
              ]
          )
  
      df = pd.DataFrame(
          [
              {key: value for (key, value) in relationship.items()}
              for relationship in graph.relationships
          ]
      )
  
      joined_df = map_dict_df.join(df)
  
      if len(joined_df) == 0:
          util.warn(
              "Query returned no edges; may have surprising visual results or need to add missing columns for encodings"
          )
          return pd.DataFrame(
              {
                  relationship_id_key: pd.Series([], dtype="int32"),
                  relationship_type_key: pd.Series([], dtype="int32"),
                  start_node_id_key: pd.Series([], dtype="int32"),
                  end_node_id_key: pd.Series([], dtype="int32"),
              }
          )
      return neo_df_to_pd_df(joined_df)
  
file_path: pygraphistry/graphistry/bolt_util.py
imports: import pandas
  from datetime import datetime
  from .pygraphistry import util
  from .util import setup_logger
label_desc: Use image node_id 2 for calling a global function with example usage: bolt_graph_to_edges_dataframe(graph) and returns: neo_df_to_pd_df, pd