Skip to content

Feature Request: Support marking mode in addition to filtering mode for ASTRef chain operations #755

Description

@lmeyerov

Feature Request: Marking mode for chain operations

Background

While fixing PR #751, discovered ASTRef was marking instead of filtering. Fixed to filter (correct for data flow), but marking has value.

Proposed Contexts for Marking Mode

1. Chain Operations with Matchers

# Mark matching nodes in chain
Chain([n({'type': 'person'}).mark()])  # Returns all nodes with 'is_person' column

2. Within Let() Bindings

# Order-sensitive marking in DAG context
let({
    'marked_people': n({'type': 'person'}).mark(),  # Marks but doesn't filter
    'marked_companies': n({'type': 'company'}).mark(),  # Can see previous marks
    'high_value': n({'value': {'': 1000}}).mark()  # Accumulates marks
})
# Result: Full graph with multiple boolean columns

3. Match Context (Future)

# Pattern matching with marking
match(pattern).mark()  # Marks matched subgraphs

Key Design Questions

  • Chain context: Should .mark() be on matchers (n/e) or Chain?
  • Let context: How to handle order-sensitive accumulation?
  • API: .mark() method vs mode parameter?
  • Column naming: Auto-generate or user-specified?

Implementation Notes

  • Marking logic exists (removed in cdaccd9)
  • Need conditional marking vs filtering
  • Consider performance implications

Related: PR #751, Issue #755

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions