Overlapping window with tf.data.experimental.make_csv_dataset
Hi @ek-ex ,

Instead of applying flat_map directly on a WindowDataset could you please try batch seprately.

```
dataset = tf.data.experimental.make_csv_dataset(
    file_pattern="/path/stock/*1min*.csv",
    batch_size=1,
    num_epochs=1,
    shuffle=False,
    header=False,
    column_names=['timestamp','open','high', 'low', 'close', 'volume'],
    column_defaults=[tf.string, tf.float32, tf.float32, tf.float32, tf.float32, tf.float32]
).window(
    size=5,  # Number of rows per window
    shift=1,  # Stride for overlapping windows
    stride=1
)
dataset=dataset.batch(5)
``` This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. Hi @SuryanarayanaY thank you for your response. 
Applying `.batch(5)` to the dataset generates a NestedVariant dataset and I havent found a way to extract the contents of the dataset or iterate over it. 

The structure that this generates is: 

```
take = dataset.take(1)
print (f'{type(dataset)}')
for data in take:
  print (f'\t{type(data)}')
  for key, value in data.items():
    print (f'\t\t{key} --> {value}')
    #for tensor in value:
    #  print(f'\t\t\t{type(tensor)} --> {tf.size(tensor)} --> {tensor[0]}')
```
prints the following: 
```
<class 'tensorflow.python.data.ops.batch_op._BatchDataset'>
	<class 'collections.OrderedDict'>
		timestamp --> <tensorflow.python.data.ops.dataset_ops._NestedVariant object at 0x7db68f7c3a00>
		open --> <tensorflow.python.data.ops.dataset_ops._NestedVariant object at 0x7db68f7c22c0>
		high --> <tensorflow.python.data.ops.dataset_ops._NestedVariant object at 0x7db68f7c0580>
		low --> <tensorflow.python.data.ops.dataset_ops._NestedVariant object at 0x7db68f7c0310>
		close --> <tensorflow.python.data.ops.dataset_ops._NestedVariant object at 0x7db68f7c1120>
		volume --> <tensorflow.python.data.ops.dataset_ops._NestedVariant object at 0x7db68f7c0790>
``` Hi @ek-ex ,

It would help us to debug if we can get a reproducible code snippet along with the dependent resources. Thanks! Hi @ek-ex ,

This still missing the dataset CSV file. Please refer [gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/267f370cfa12e131483adc8e640182d7/63044.ipynb) and provide the details. 

Please also note that this repo is for reporting bugs and performance related issues. If it is pure support you can reachout TF-forum also with all the details. This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.
### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

2.8

### Custom code

No

### OS platform and distribution

_No response_

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Window dataset coming from the  tf.data.experimental.make_csv_dataset is not working as expected

### Standalone code to reproduce the issue

```shell
I'm trying to transform some data read from CSV files using tf.data pipelines and overlapping windows and its not working as expected. All the documentation is not providing clear explanation on how to deal with this case. The columns of the csv files are 'timestamp','open','high', 'low', 'close', 'volume'.


dataset = tf.data.experimental.make_csv_dataset(
    file_pattern="/path/stock/*1min*.csv",
    batch_size=1,
    num_epochs=1,
    shuffle=False,
    header=False,
    column_names=['timestamp','open','high', 'low', 'close', 'volume'],
    column_defaults=[tf.string, tf.float32, tf.float32, tf.float32, tf.float32, tf.float32]
).window(
    size=5,  # Number of rows per window
    shift=1,  # Stride for overlapping windows
    stride=1
)
```
This produces the following structure:
```
-WindowDataset
--OrderedDict
---VariantDataset
----Tensor (single element)
----Tensor...
```
This is not allowing me to transform in a simple way because OrderedDict has not batch method and I cannot flatten following the documentation.

```
dataset = tf.data.experimental.make_csv_dataset(
    file_pattern="/path/stock/*1min*.csv",
    batch_size=1,
    num_epochs=1,
    shuffle=False,
    header=False,
    column_names=['timestamp','open','high', 'low', 'close', 'volume'],
    column_defaults=[tf.string, tf.float32, tf.float32, tf.float32, tf.float32, tf.float32]
).window(
    size=5,  # Number of rows per window
    shift=1,  # Stride for overlapping windows
    stride=1
).flat_map(lambda window: window.batch(5))
```
Gives the following error:
```
AttributeError                            Traceback (most recent call last)

<ipython-input-47-46d1550f08a0> in <cell line: 1>()
     11     shift=1,  # Stride for overlapping windows
     12     stride=1
---> 13 ).flat_map(lambda window: window.batch(5))

19 frames

/tmp/__autograph_generated_filersrgq3km.py in <lambda>(lscope)
      3 
      4     def inner_factory(ag__):
----> 5         tf__lam = lambda window: ag__.with_function_scope(lambda lscope: ag__.converted_call(window.batch, (5,), None, lscope), 'lscope', ag__.STD)
      6         return tf__lam
      7     return inner_factory

AttributeError: in user code:

    File "<ipython-input-47-46d1550f08a0>", line 13, in None  *
        lambda window: window.batch(5)

    AttributeError: 'collections.OrderedDict' object has no attribute 'batch'
```
If I try to batch the datasets of the OrderedDict, I get the following error

---------------------------------------------------------------------------
```
AttributeError                            Traceback (most recent call last)

<ipython-input-59-16e14170c082> in <cell line: 25>()
     23 
     24 
---> 25 data = dataset.map(extract)
     26 
     27 

35 frames

/usr/local/lib/python3.10/dist-packages/tensorflow/python/framework/tensor.py in __getattr__(self, name)
    259         tf.experimental.numpy.experimental_enable_numpy_behavior()
    260       """)
--> 261     self.__getattribute__(name)
    262 
    263   @property

AttributeError: in user code:

    File "<ipython-input-59-16e14170c082>", line 3, in extract  *
        opens = data.get('open').flat_map(lambda x: x.batch(5))

    AttributeError: 'SymbolicTensor' object has no attribute 'batch'
```
This is becoming extremely confusing.

What would be a the right way to transform this structure so that I can later apply better transformations to build a timeseries dataset.
```


### Relevant log output

_No response_