Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft of text data record #303

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

igorapple
Copy link
Collaborator

Description

Draft implementation of TextDataRecord class which will translate provided data into human readable text.

How Has This Been Tested?

Unit tests will be available soon.

Process

I know the process and did my best to follow it

@igorapple igorapple linked an issue Jan 28, 2025 that may be closed by this pull request
@igorapple igorapple marked this pull request as draft January 28, 2025 19:46
@igorapple igorapple added the implementation Changes to code label Jan 28, 2025
@igorapple igorapple added this to the 6) Database introduction milestone Jan 28, 2025
Copy link

codecov bot commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 0% with 38 lines in your changes missing coverage. Please review.

Project coverage is 98.70%. Comparing base (a2ee482) to head (4b64873).

Files with missing lines Patch % Lines
uds/database/data_record/text_data_record.py 0.00% 38 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##              main     #303      +/-   ##
===========================================
- Coverage   100.00%   98.70%   -1.30%     
===========================================
  Files           49       50       +1     
  Lines         2890     2928      +38     
  Branches       356      360       +4     
===========================================
  Hits          2890     2890              
- Misses           0       38      +38     
Flag Coverage Δ
integration-tests 79.47% <0.00%> (-1.05%) ⬇️
integration-tests-branch 74.62% <0.00%> (-0.99%) ⬇️
unit-tests 98.70% <0.00%> (-1.30%) ⬇️
unit-tests-branch 98.70% <0.00%> (-1.30%) ⬇️
Files with missing lines Coverage Δ
uds/database/data_record/text_data_record.py 0.00% <0.00%> (ø)

from .raw_data_record import RawDataRecord


class TextDataRecord(RawDataRecord, AbstractDataRecord):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, call it TextTableDataRecord (cause we are going to have one more text data record)

if isinstance(physical_value, int):
return physical_value
if isinstance(physical_value, str):
if physical_value in self.__reversed_mapping:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use self.reversed_mapping instead of self.__reversed_mapping

return physical_value
if isinstance(physical_value, str):
if physical_value in self.__reversed_mapping:
return self.__reversed_mapping[physical_value]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Owner

@mdabrowski1990 mdabrowski1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, just a few tiny remarks left from me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implementation Changes to code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce Mapping Data Record (signal for message database)
2 participants