Skip to content

Commit

Permalink
feat!: drop forget_length in typetracer_with_report
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Nov 8, 2023
1 parent ec261c2 commit c90845e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
8 changes: 2 additions & 6 deletions src/awkward/_nplikes/typetracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1588,13 +1588,9 @@ def _attach_report(


def typetracer_with_report(
form: ak.forms.Form,
getkey: Callable[[Form, str], str],
forget_length: bool = True,
form: ak.forms.Form, getkey: Callable[[Form, str], str]
) -> tuple[ak.contents.Content, TypeTracerReport]:
layout = form.length_zero_array(highlevel=False).to_typetracer(
forget_length=forget_length
)
layout = form.length_zero_array(highlevel=False).to_typetracer(forget_length=True)
report = TypeTracerReport()
_attach_report(layout, form, report, getkey)
return layout, report
17 changes: 1 addition & 16 deletions src/awkward/typetracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import awkward.forms
from awkward._backends.typetracer import TypeTracerBackend
from awkward._do import touch_data as _touch_data
from awkward._errors import deprecate
from awkward._layout import HighLevelContext, wrap_layout
from awkward._nplikes.placeholder import PlaceholderArray
from awkward._nplikes.shape import unknown_length
Expand All @@ -20,7 +19,6 @@
typetracer_with_report as _typetracer_with_report,
)
from awkward._typing import Any, TypeVar
from awkward._util import UNSET
from awkward.contents import Content
from awkward.forms import Form
from awkward.forms.form import regularize_buffer_key
Expand Down Expand Up @@ -153,7 +151,6 @@ def touch_data(

def typetracer_with_report(
form: Form | str | Mapping,
forget_length: bool = UNSET,
*,
buffer_key: str | Callable = "{form_key}",
highlevel: bool = False,
Expand Down Expand Up @@ -190,21 +187,9 @@ def typetracer_with_report(
"'form' argument must be a Form or its Python dict/JSON string representation"
)

if forget_length is UNSET:
forget_length = True
else:
deprecate(
"passing `forget_length` to typetracer_with_report is deprecated. "
"In future, this argument will be removed, and the function will "
"always forget lengths",
"2.5.0",
)

getkey = regularize_buffer_key(buffer_key)

layout, report = _typetracer_with_report(
form, getkey=getkey, forget_length=forget_length
)
layout, report = _typetracer_with_report(form, getkey=getkey)
return wrap_layout(
layout, behavior=behavior, highlevel=highlevel, attrs=attrs
), report
Expand Down
4 changes: 1 addition & 3 deletions tests/test_2806_attrs_typetracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import pytest

import awkward as ak
from awkward.typetracer import (
typetracer_with_report,
)
from awkward.typetracer import typetracer_with_report

SOME_ATTRS = {"foo": "FOO"}

Expand Down

0 comments on commit c90845e

Please sign in to comment.