<commit_before>import React, {Children, cloneElement} from 'react';
import PropTypes from 'prop-types';
import getAttrs from '../util/getAttrs';

/**
 * Grid row. Use this to define a grid containing a set of columns.
 *
 * @param {Object} props - Component props.
 * @returns {Object} Row HTML.
 *
 * @example
 * <Row>
 *   <Column></Column>
 * </Row>
 */
export default function Row(props) {
  return (
    <table {...getAttrs(props, 'table', 'row')}>
      <tbody>
        {/* `first` and `last` props are added to the first and last child in the row, respectively */}
        <tr>{Children.map(props.children, (child, index) => cloneElement(child, {
          first: index === 0,
          last: index === Children.count(props.children) - 1
        }))}
        </tr>
      </tbody>
    </table>
  );
}

/**
 * Prop types for `<Row />`.
 * @type Object
 * @prop [children] - Child elements.
 */
Row.propTypes = {
  children: PropTypes.node
};

/**
 * Default props for `<Row />`.
 * @type Object
 */
Row.defaultProps = {
  children: null
};
<commit_msg>Prevent <Row /> from adding props to children that aren't columns<commit_after>import React, {Children, cloneElement} from 'react';
import PropTypes from 'prop-types';
import getAttrs from '../util/getAttrs';
import Column from './Column';

/**
 * Grid row. Use this to define a grid containing a set of columns.
 *
 * @param {Object} props - Component props.
 * @returns {Object} Row HTML.
 *
 * @example
 * <Row>
 *   <Column></Column>
 * </Row>
 */
export default function Row(props) {
  return (
    <table {...getAttrs(props, 'table', 'row')}>
      <tbody>
        {/* `first` and `last` props are added to the first and last child in the row, respectively */}
        <tr>{Children.map(props.children, (child, index) => {
          if (child.type === Column) {
            return cloneElement(child, {
              first: index === 0,
              last: index === Children.count(props.children) - 1
            });
          }

          return child;
        })}
        </tr>
      </tbody>
    </table>
  );
}

/**
 * Prop types for `<Row />`.
 * @type Object
 * @prop [children] - Child elements.
 */
Row.propTypes = {
  children: PropTypes.node
};

/**
 * Default props for `<Row />`.
 * @type Object
 */
Row.defaultProps = {
  children: null
};

{'fraction_non_alphanumeric': 0.16529995684074233, 'fraction_numerical': 0.0017263703064307294, 'mean_word_length': 2.4857142857142858, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3671731', 'n_tokens_mistral': 718, 'n_tokens_neox': 715, 'n_words': 223}