We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46aebcd commit ba5cf3dCopy full SHA for ba5cf3d
mitreattack/attackToExcel/stixToDf.py
@@ -974,7 +974,13 @@ def relationshipsToDf(src, relatedType=None):
974
relationship_rows.append(row)
975
976
citations = get_citations(relationships)
977
- relationships = pd.DataFrame(relationship_rows).sort_values(
+
978
+ relationship_df = pd.DataFrame(relationship_rows)
979
+ if relationship_df.empty or "mapping type" not in relationship_df.columns:
980
+ logger.warning(f"No relationships found for relatedType={relatedType}. Returning empty dataframe.")
981
+ return {}
982
983
+ relationships = relationship_df.sort_values(
984
[
985
"mapping type",
986
"source type",
0 commit comments